Switch to WebClient.DownloadFile for reliable redirect handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
uhlwoogi
2026-04-15 10:51:10 +00:00
co-authored by Claude Sonnet 4.6
parent 2b95f87565
commit 640567d03e
2 changed files with 2 additions and 2 deletions
@@ -29,7 +29,7 @@ function Install-RustDesk {
# Download
Write-Host "Downloading ScoutIT Remote Support client..."
Try {
Invoke-WebRequest -Uri $rustdeskDl -OutFile $msiPath -UseBasicParsing
(New-Object System.Net.WebClient).DownloadFile($rustdeskDl, $msiPath)
}
Catch {
Write-Warning "RustDesk download failed: $($_.Exception.Message)"
+1 -1
View File
@@ -20,7 +20,7 @@ if ($null -ne $svcCheck) {
$msiPath = "$env:SystemRoot\Temp\$rustdeskMsi"
Write-Host "Downloading ScoutIT Remote Support client..."
Try {
Invoke-WebRequest -Uri $rustdeskDl -OutFile $msiPath -UseBasicParsing
(New-Object System.Net.WebClient).DownloadFile($rustdeskDl, $msiPath)
}
Catch {
Write-Error "Download failed: $($_.Exception.Message)"