mirror of
https://github.com/actions/runner-images.git
synced 2026-01-02 16:24:24 +08:00
[Ubuntu] Replace WebClient with Invoke-WebRequest (#12434)
Co-authored-by: baidarka <baidarka@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user