azure-pipelines: Use Invoke-WebRequest to download files

When running System.Net.WebClient locally it results in a
non-descriptive "An exception occurred during a WebClient request" error
message. Invoke-WebRequest is an alternative that works so switch to
that.
This commit is contained in:
Povilas Kanapickas 2021-10-28 04:00:43 -07:00
parent fce7615e42
commit a4ff91a991
2 changed files with 2 additions and 4 deletions

View File

@ -1,8 +1,7 @@
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
New-Item -Force -ItemType Directory -Path ".\deps\" New-Item -Force -ItemType Directory -Path ".\deps\"
$Wc = New-Object System.Net.WebClient Invoke-WebRequest 'https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip' -OutFile 'deps\BonjourSDKLike.zip' ;
$Wc.DownloadFile('https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip', 'deps\BonjourSDKLike.zip') ;
Write-Output 'Downloaded BonjourSDKLike Zip' Write-Output 'Downloaded BonjourSDKLike Zip'
Write-Output 'Unzipping BonjourSDKLike Zip' Write-Output 'Unzipping BonjourSDKLike Zip'
Remove-Item -Recurse -Force -ErrorAction Ignore .\deps\BonjourSDKLike Remove-Item -Recurse -Force -ErrorAction Ignore .\deps\BonjourSDKLike

View File

@ -6,8 +6,7 @@ $qt_version = '5.13.0'
New-Item -Force -ItemType Directory -Path ".\deps\" New-Item -Force -ItemType Directory -Path ".\deps\"
Write-Output 'Downloading QLI Installer' Write-Output 'Downloading QLI Installer'
$Wc = New-Object System.Net.WebClient Invoke-WebRequest "https://github.com/nelsonjchen/qli-installer/archive/v$qli_install_version.zip" -OutFile '.\deps\qli-installer.zip' ;
$Wc.DownloadFile("https://github.com/nelsonjchen/qli-installer/archive/v$qli_install_version.zip", '.\deps\qli-installer.zip') ;
Write-Output 'Downloaded QLI Installer' Write-Output 'Downloaded QLI Installer'
Write-Output 'Extracting QLI Installer' Write-Output 'Extracting QLI Installer'