Switch to WebClient.DownloadFile for reliable redirect handling
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
2b95f87565
commit
640567d03e
@@ -29,7 +29,7 @@ function Install-RustDesk {
|
|||||||
# Download
|
# Download
|
||||||
Write-Host "Downloading ScoutIT Remote Support client..."
|
Write-Host "Downloading ScoutIT Remote Support client..."
|
||||||
Try {
|
Try {
|
||||||
Invoke-WebRequest -Uri $rustdeskDl -OutFile $msiPath -UseBasicParsing
|
(New-Object System.Net.WebClient).DownloadFile($rustdeskDl, $msiPath)
|
||||||
}
|
}
|
||||||
Catch {
|
Catch {
|
||||||
Write-Warning "RustDesk download failed: $($_.Exception.Message)"
|
Write-Warning "RustDesk download failed: $($_.Exception.Message)"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if ($null -ne $svcCheck) {
|
|||||||
$msiPath = "$env:SystemRoot\Temp\$rustdeskMsi"
|
$msiPath = "$env:SystemRoot\Temp\$rustdeskMsi"
|
||||||
Write-Host "Downloading ScoutIT Remote Support client..."
|
Write-Host "Downloading ScoutIT Remote Support client..."
|
||||||
Try {
|
Try {
|
||||||
Invoke-WebRequest -Uri $rustdeskDl -OutFile $msiPath -UseBasicParsing
|
(New-Object System.Net.WebClient).DownloadFile($rustdeskDl, $msiPath)
|
||||||
}
|
}
|
||||||
Catch {
|
Catch {
|
||||||
Write-Error "Download failed: $($_.Exception.Message)"
|
Write-Error "Download failed: $($_.Exception.Message)"
|
||||||
|
|||||||
Reference in New Issue
Block a user