From 7a89f0b85e1bb29ed3c31feee24a69ca72ece0ba Mon Sep 17 00:00:00 2001 From: David Yoder Date: Wed, 1 Nov 2023 15:47:27 -0400 Subject: [PATCH] switch to BITS for file download --- Tools.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools.ps1 b/Tools.ps1 index a84c4e5..2b5012f 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -189,7 +189,8 @@ Function Download-File { $URI = Get-AbsoluteURI -URL $URL If ( $null -eq $URI ) { Return } If ( [string]::IsNullOrEmpty($File) ) { $File = '{0}{1}' -f (Get-TempPath), (Split-Path $URI -Leaf) } - Try { (New-Object System.Net.WebClient).DownloadFile($URI,$File) } + #Try { (New-Object System.Net.WebClient).DownloadFile($URI,$File) } + Try { Start-BitsTransfer -Source $URI -Destination $File } Catch { Write-Error $_.Exception.Message ; Return } Return $File }