We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d99899e commit ecdaa50Copy full SHA for ecdaa50
1 file changed
scripts/environment/bootstrap-windows-2025.ps1
@@ -11,7 +11,10 @@ function Install-ChocoPackage {
11
12
for ($attempt = 1; $attempt -le $MaxRetries; $attempt++) {
13
choco install $Package --execution-timeout=7200 -y
14
- if ($LASTEXITCODE -eq 0) {
+ # Both `choco install` and `choco list` can exit 0 even on 5xx errors
15
+ # from the feed, so verify install by matching a "name|version" line
16
+ # in the list output. --limit-output strips headers/warnings.
17
+ if ((choco list --limit-output -e $Package) -match "^$([regex]::Escape($Package))\|") {
18
return
19
}
20
0 commit comments