mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
changed installvsix. added downloadwithretry func
This commit is contained in:
@@ -217,34 +217,7 @@ function Install-VsixExtension
|
|||||||
|
|
||||||
if (!$InstallOnly)
|
if (!$InstallOnly)
|
||||||
{
|
{
|
||||||
$FilePath = "${env:Temp}\$Name"
|
$FilePath = Start-DownloadWithRetry -Url $Url -Name $Name
|
||||||
|
|
||||||
while($retries -gt 0)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Write-Host "Downloading $Name..."
|
|
||||||
(New-Object System.Net.WebClient).DownloadFile($Url, $FilePath)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Write-Host "There is an error during $Name downloading"
|
|
||||||
$_
|
|
||||||
|
|
||||||
$retries--
|
|
||||||
|
|
||||||
if ($retries -eq 0)
|
|
||||||
{
|
|
||||||
Write-Host "File can't be downloaded"
|
|
||||||
$_
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Waiting 30 seconds before retrying. Retries left: $retries"
|
|
||||||
Start-Sleep -Seconds 30
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ArgumentList = ('/quiet', "`"$FilePath`"")
|
$ArgumentList = ('/quiet', "`"$FilePath`"")
|
||||||
|
|||||||
Reference in New Issue
Block a user