changed installvsix. added downloadwithretry func

This commit is contained in:
Dariy.Nurgaleev
2020-03-20 11:38:05 +07:00
parent ee85085885
commit fbf0e5ea07

View File

@@ -217,34 +217,7 @@ function Install-VsixExtension
if (!$InstallOnly)
{
$FilePath = "${env:Temp}\$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
}
}
$FilePath = Start-DownloadWithRetry -Url $Url -Name $Name
}
$ArgumentList = ('/quiet', "`"$FilePath`"")