Skip to content

Commit c471ba1

Browse files
[Ubuntu] Replace WebClient with Invoke-WebRequest (#12434)
Co-authored-by: baidarka <[email protected]>
1 parent f7879fa commit c471ba1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

images/ubuntu/scripts/helpers/Common.Helpers.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function Invoke-DownloadWithRetry {
129129
for ($retries = 20; $retries -gt 0; $retries--) {
130130
try {
131131
$attemptStartTime = Get-Date
132-
(New-Object System.Net.WebClient).DownloadFile($Url, $DestinationPath)
132+
Invoke-WebRequest -Uri $Url -Outfile $DestinationPath
133133
$attemptSeconds = [math]::Round(($(Get-Date) - $attemptStartTime).TotalSeconds, 2)
134134
Write-Host "Package downloaded in $attemptSeconds seconds"
135135
break

0 commit comments

Comments
 (0)