From fbf0e5ea07a09d2d4b6420e5e785058808214276 Mon Sep 17 00:00:00 2001 From: "Dariy.Nurgaleev" Date: Fri, 20 Mar 2020 11:38:05 +0700 Subject: [PATCH] changed installvsix. added downloadwithretry func --- .../scripts/ImageHelpers/InstallHelpers.ps1 | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index 910fbe5c..8ba4594e 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -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`"")