Revert TacticalRMM download changes - AV interference confirmed

Rolling back to pre-session state (d0fa18f). Download failures were caused
by antivirus SSL inspection, not the script. Restore original
Test-NetConnection flow while AV exclusion is sorted out.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
uhlwoogi
2026-04-21 16:49:12 +00:00
co-authored by Claude Sonnet 4.6
parent 20fd7f7f6f
commit 647713ce9c
+28 -17
View File
@@ -175,25 +175,36 @@ If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
Catch { # pass Catch { # pass
} }
Try { $X = 0
Write-Host "Downloading TacticalRMM agent..." do {
Start-BitsTransfer -Source $downloadlink -Destination "$OutPath\$output" -ErrorAction Stop Write-Output "Waiting for network"
Write-Host "Download complete."
Start-Process -FilePath "$OutPath\$output" -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES' -Wait
Write-Host "Extracting..."
Start-Sleep -s 5 Start-Sleep -s 5
Start-Process -FilePath "C:\Program Files\TacticalAgent\tacticalrmm.exe" -ArgumentList $installArgs -Wait $X += 1
} until (($connectresult = Test-NetConnection $apilink[2] -Port 443 | Where-Object { $_.TcpTestSucceeded }) -or $X -eq 3)
# ── Install RustDesk after Tactical RMM ── if ($connectresult.TcpTestSucceeded -eq $true) {
Install-RustDesk Try {
Invoke-WebRequest -Uri $downloadlink -OutFile "$OutPath\$output"
Start-Process -FilePath "$OutPath\$output" -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES' -Wait
Write-Host "Extracting..."
Start-Sleep -s 5
Start-Process -FilePath "C:\Program Files\TacticalAgent\tacticalrmm.exe" -ArgumentList $installArgs -Wait
exit 0 # ── Install RustDesk after Tactical RMM ──
} Install-RustDesk
Catch {
Write-Warning "TacticalRMM install failed: $($_.Exception.Message)" exit 0
exit 1 }
} Catch {
Finally { $ErrorMessage = $_.Exception.Message
if (Test-Path "$OutPath\$output") { Remove-Item -Path "$OutPath\$output" -Force } $FailedItem = $_.Exception.ItemName
Write-Error -Message "$ErrorMessage $FailedItem"
exit 1
}
Finally {
if (Test-Path "$OutPath\$output") { Remove-Item -Path "$OutPath\$output" -Force }
}
} else {
Write-Output "Unable to connect to server"
} }
} }