diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 424c7b85..1698c550 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -14,7 +14,7 @@ "virtual_network_resource_group_name": "{{env `VNET_RESOURCE_GROUP`}}", "virtual_network_subnet_name": "{{env `VNET_SUBNET`}}", "private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}", - "vm_size": "Standard_DS4_v2", + "vm_size": "Standard_D4_v2", "run_scan_antivirus": "false", "root_folder": "C:", diff --git a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 index 03c4b98f..a016e5fd 100644 --- a/images/win/scripts/ImageHelpers/InstallHelpers.ps1 +++ b/images/win/scripts/ImageHelpers/InstallHelpers.ps1 @@ -169,35 +169,36 @@ function Start-DownloadWithRetry [Parameter(Mandatory)] [string] $Name, [string] $DownloadPath = "${env:Temp}", - [int] $retries = 20 - ) - $FilePath = Join-Path $DownloadPath $Name - #Default retry logic for the package. - while($retries -gt 0) - { - try - { - Write-Host "Downloading package from: $Url to path $FilePath ." - (New-Object System.Net.WebClient).DownloadFile($Url, $FilePath) - break - } - catch - { - Write-Host "There is an error during package downloading" - $_ - $retries-- + [int] $Retries = 20 + ) - if ($retries -eq 0) - { - Write-Host "File can't be downloaded. Please try later or check that file exists by url: $Url" - $_ - exit 1 - } - Write-Host "Waiting 30 seconds before retrying. Retries left: $retries" - Start-Sleep -Seconds 30 - } + $FilePath = Join-Path -Path $DownloadPath -ChildPath $Name + #Default retry logic for the package. + while ($retries -gt 0) + { + try + { + Write-Host "Downloading package from: $Url to path $FilePath ." + (New-Object System.Net.WebClient).DownloadFile($Url, $FilePath) + break } - return $FilePath + catch + { + Write-Host "There is an error during package downloading:`n $_" + $retries-- + + if ($retries -eq 0) + { + Write-Host "File can't be downloaded. Please try later or check that file exists by url: $Url" + exit 1 + } + + Write-Host "Waiting 30 seconds before retrying. Retries left: $retries" + Start-Sleep -Seconds 30 + } + } + + return $FilePath }