From eb1fecb886582ec8b10cc24ba942ad0c373a3c34 Mon Sep 17 00:00:00 2001 From: uhlwoogi Date: Tue, 21 Apr 2026 16:30:56 +0000 Subject: [PATCH] Remove Test-NetConnection check that caused false failures The TCP connectivity test would stall on reverse DNS lookups and exhaust its 3-retry limit even on machines with working internet. Let Invoke-WebRequest fail naturally with a real error instead. Co-Authored-By: Claude Sonnet 4.6 --- ...tudio-Install-TacticalRMM-and-RustDesk.ps1 | 45 +++++++------------ 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/1-estudio-Install-TacticalRMM-and-RustDesk.ps1 b/1-estudio-Install-TacticalRMM-and-RustDesk.ps1 index 7792415..795a53b 100644 --- a/1-estudio-Install-TacticalRMM-and-RustDesk.ps1 +++ b/1-estudio-Install-TacticalRMM-and-RustDesk.ps1 @@ -175,36 +175,25 @@ If (Get-Service $serviceName -ErrorAction SilentlyContinue) { Catch { # pass } - $X = 0 - do { - Write-Output "Waiting for network" + Try { + Invoke-WebRequest -Uri $downloadlink -OutFile "$OutPath\$output" + Start-Process -FilePath "$OutPath\$output" -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES' -Wait + Write-Host "Extracting..." Start-Sleep -s 5 - $X += 1 - } until (($connectresult = Test-NetConnection $apilink[2] -Port 443 | Where-Object { $_.TcpTestSucceeded }) -or $X -eq 3) + Start-Process -FilePath "C:\Program Files\TacticalAgent\tacticalrmm.exe" -ArgumentList $installArgs -Wait - 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 + # ── Install RustDesk after Tactical RMM ── + Install-RustDesk - # ── 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" + 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 } } }