diff --git a/scripts/generate-solution-filters.ps1 b/scripts/generate-solution-filters.ps1 index 6ba5501807..94ba868883 100644 --- a/scripts/generate-solution-filters.ps1 +++ b/scripts/generate-solution-filters.ps1 @@ -14,7 +14,15 @@ while (-not (Get-Module -ListAvailable -Name $yamlModule) -and $retries -gt 0) Start-Sleep -Seconds 10 } Write-Debug "The module '$yamlModule' is not installed. Installing..." - Install-Module -Name $yamlModule -Scope CurrentUser -Force + try + { + Install-Module -Name $yamlModule -Scope CurrentUser -Force + } + catch + { + # $ErrorActionPreference is Stop, so without the catch a failed download ends the script instead of retrying + Write-Warning "Couldn't install '$yamlModule': $_" + } $retries-- }