From a4ff91a9914a94d62769017313be2cbb4d777208 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Thu, 28 Oct 2021 04:00:43 -0700 Subject: [PATCH] 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. --- azure-pipelines/download_install_bonjour_sdk_like.ps1 | 3 +-- azure-pipelines/download_install_qt.ps1 | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines/download_install_bonjour_sdk_like.ps1 b/azure-pipelines/download_install_bonjour_sdk_like.ps1 index 97bfa832..7f5fcb96 100644 --- a/azure-pipelines/download_install_bonjour_sdk_like.ps1 +++ b/azure-pipelines/download_install_bonjour_sdk_like.ps1 @@ -1,8 +1,7 @@ $ErrorActionPreference = "Stop" New-Item -Force -ItemType Directory -Path ".\deps\" -$Wc = New-Object System.Net.WebClient -$Wc.DownloadFile('https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip', 'deps\BonjourSDKLike.zip') ; +Invoke-WebRequest 'https://github.com/nelsonjchen/mDNSResponder/releases/download/v2019.05.08.1/x64_RelWithDebInfo.zip' -OutFile 'deps\BonjourSDKLike.zip' ; Write-Output 'Downloaded BonjourSDKLike Zip' Write-Output 'Unzipping BonjourSDKLike Zip' Remove-Item -Recurse -Force -ErrorAction Ignore .\deps\BonjourSDKLike diff --git a/azure-pipelines/download_install_qt.ps1 b/azure-pipelines/download_install_qt.ps1 index e31b9b7a..a4b51d2c 100644 --- a/azure-pipelines/download_install_qt.ps1 +++ b/azure-pipelines/download_install_qt.ps1 @@ -6,8 +6,7 @@ $qt_version = '5.13.0' New-Item -Force -ItemType Directory -Path ".\deps\" Write-Output 'Downloading QLI Installer' -$Wc = New-Object System.Net.WebClient -$Wc.DownloadFile("https://github.com/nelsonjchen/qli-installer/archive/v$qli_install_version.zip", '.\deps\qli-installer.zip') ; +Invoke-WebRequest "https://github.com/nelsonjchen/qli-installer/archive/v$qli_install_version.zip" -OutFile '.\deps\qli-installer.zip' ; Write-Output 'Downloaded QLI Installer' Write-Output 'Extracting QLI Installer'