# Define variables $url = "https://services.nextech.com/Client/Update/NxTSAddin/NxTSAddinSetup.exe" $outputDir = "$env:TEMP" $outputFile = Join-Path $outputDir "NxTSAddinSetup.exe" $ProgressPreference = 'SilentlyContinue' # 1. Download the installer Write-Host "Downloading Nextech TS Add-in..." -ForegroundColor Cyan Invoke-WebRequest -Uri $url -OutFile $outputFile # 2. Run the installer silently Write-Host "Installing Nextech TS Add-in silently..." -ForegroundColor Cyan # Common switch combinations for this installer format $processArgs = "/s /silent /norestart" $process = Start-Process -FilePath $outputFile -ArgumentList $processArgs -Wait -PassThru # 3. Check exit code and clean up if ($process.ExitCode -eq 0) { Write-Host "Nextech TS Add-in installed successfully." -ForegroundColor Green } else { Write-Warning "Installation finished with exit code: $($process.ExitCode)" } # Remove the installer file from temp if (Test-Path $outputFile) { Remove-Item $outputFile -Force Write-Host "Cleaned up installer file." -ForegroundColor Cyan }