Skip to content

Commit ecdaa50

Browse files
fix(ci): verify choco package install after 5xx from feed (#25116)
* fix(ci): verify choco package install after 5xx from feed * fix(ci): match package name in choco list output to verify install
1 parent d99899e commit ecdaa50

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/environment/bootstrap-windows-2025.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ function Install-ChocoPackage {
1111

1212
for ($attempt = 1; $attempt -le $MaxRetries; $attempt++) {
1313
choco install $Package --execution-timeout=7200 -y
14-
if ($LASTEXITCODE -eq 0) {
14+
# 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))\|") {
1518
return
1619
}
1720

0 commit comments

Comments
 (0)