diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-01-17 17:31:22 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-01-17 17:34:40 -0800 |
| commit | 3390007020921b41e3d4d42ad9b46c671250743a (patch) | |
| tree | 4037fbd1e95e9af32385c3e023a9f1ba58286858 /scripts | |
| parent | 8e773df065096fe81e3d888b6b844cbecfbc18e6 (diff) | |
| download | vcpkg-3390007020921b41e3d4d42ad9b46c671250743a.tar.gz vcpkg-3390007020921b41e3d4d42ad9b46c671250743a.zip | |
[powershell] Remove usages of BitsTransfer
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 27 |
1 files changed, 0 insertions, 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 } |
