From c471ba13993a4f5cf9979179d06da69fd7d31038 Mon Sep 17 00:00:00 2001 From: akilesh-amaran Date: Mon, 23 Jun 2025 19:57:54 +0530 Subject: [PATCH] [Ubuntu] Replace WebClient with Invoke-WebRequest (#12434) Co-authored-by: baidarka --- images/ubuntu/scripts/helpers/Common.Helpers.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/ubuntu/scripts/helpers/Common.Helpers.psm1 b/images/ubuntu/scripts/helpers/Common.Helpers.psm1 index ffefd2986..5f64d2b9e 100644 --- a/images/ubuntu/scripts/helpers/Common.Helpers.psm1 +++ b/images/ubuntu/scripts/helpers/Common.Helpers.psm1 @@ -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