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
}
Try {
Write-Host "Downloading TacticalRMM agent..."
Start-BitsTransfer -Source $downloadlink -Destination "$OutPath\$output" -ErrorAction Stop
Write-Host "Download complete."
Start-Process -FilePath "$OutPath\$output" -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES' -Wait
Write-Host "Extracting..."
$X = 0
do {
Write-Output "Waiting for network"
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 ──
Install-RustDesk
if ($connectresult.TcpTestSucceeded -eq $true) {
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
}
Catch {
Write-Warning "TacticalRMM install failed: $($_.Exception.Message)"
exit 1
}
Finally {
if (Test-Path "$OutPath\$output") { Remove-Item -Path "$OutPath\$output" -Force }
# ── Install RustDesk after Tactical RMM ──
Install-RustDesk
exit 0
}
Catch {
$ErrorMessage = $_.Exception.Message
$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"
}
}