[Ubuntu] Replace WebClient with Invoke-WebRequest (#12434)

Co-authored-by: baidarka <baidarka@users.noreply.github.com>
This commit is contained in:
akilesh-amaran
2025-06-23 19:57:54 +05:30
committed by GitHub
parent f7879fa7c3
commit c471ba1399

View File

@@ -129,7 +129,7 @@ function Invoke-DownloadWithRetry {
for ($retries = 20; $retries -gt 0; $retries--) {
try {
$attemptStartTime = Get-Date
(New-Object System.Net.WebClient).DownloadFile($Url, $DestinationPath)
Invoke-WebRequest -Uri $Url -Outfile $DestinationPath
$attemptSeconds = [math]::Round(($(Get-Date) - $attemptStartTime).TotalSeconds, 2)
Write-Host "Package downloaded in $attemptSeconds seconds"
break