From 3390007020921b41e3d4d42ad9b46c671250743a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 17 Jan 2018 17:31:22 -0800 Subject: [PATCH] [powershell] Remove usages of BitsTransfer --- scripts/VcpkgPowershellUtils.ps1 | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index e394e540e..997f603e3 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -94,11 +94,6 @@ function vcpkgCheckEqualFileHash( [Parameter(Mandatory=$true)][string]$filePat } } -if (vcpkgHasModule -moduleName 'BitsTransfer') -{ - Import-Module BitsTransfer -Verbose:$false -} - function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, [Parameter(Mandatory=$true)][string]$downloadPath) { @@ -119,28 +114,6 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, $wc.Proxy.Credentials = vcpkgGetCredentials } - # Some download (e.g. git from github)fail with Start-BitsTransfer - if (vcpkgHasCommand -commandName 'Start-BitsTransfer') - { - try - { - if ($proxyAuth) - { - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyAuthentication","Basic") - $PSDefaultParameterValues.Add("Start-BitsTransfer:ProxyCredential", $wc.Proxy.Credentials) - } - Start-BitsTransfer -Source $url -Destination $downloadPartPath -ErrorAction Stop - Move-Item -Path $downloadPartPath -Destination $downloadPath - return - } - catch [System.Exception] - { - # If BITS fails for any reason, delete any potentially partially downloaded files and continue - vcpkgRemoveItem $downloadPartPath - } - } - - Write-Verbose("Downloading $Dependency...") $wc.DownloadFile($url, $downloadPartPath) Move-Item -Path $downloadPartPath -Destination $downloadPath }