Skip to content

Commit f74ed5f

Browse files
authored
Fix syntax for known failure messages in DeployWorkstation.ps1
1 parent 0e1ff30 commit f74ed5f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

DeployWorkstation.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,10 @@ function Install-StandardApps {
866866

867867
# Known permanent failure codes — not retried, shown with a friendly message
868868
$knownFailMessages = @{
869-
-1978335215 = 'Installer hash mismatch (try again later or check proxy/AV)' # 0x8A150011
870-
-1978335212 = 'Package not found in winget source (ID may have changed)' # 0x8A15002C
871-
-1978334960 = 'Installer blocked by security policy' # 0x8A150110
872-
-1978335132 = 'Installer requires reboot before proceeding' # 0x8A150064
869+
'-1978335215' = 'Installer hash mismatch (try again later or check proxy/AV)' # 0x8A150011
870+
'-1978335212' = 'Package not found in winget source (ID may have changed)' # 0x8A15002C
871+
'-1978334960' = 'Installer blocked by security policy' # 0x8A150110
872+
'-1978335132' = 'Installer requires reboot before proceeding' # 0x8A150064
873873
}
874874
$maxRetries = 2
875875
$retryDelaySec = 10
@@ -939,8 +939,8 @@ function Install-StandardApps {
939939
$script:Summary.AppsInstalled++
940940
} else {
941941
# Resolve a friendly reason — use known message or fall back to exit code
942-
$failReason = if ($knownFailMessages.ContainsKey($exitCode)) {
943-
$knownFailMessages[$exitCode]
942+
$failReason = if ($knownFailMessages.ContainsKey("$exitCode")) {
943+
$knownFailMessages["$exitCode"]
944944
} else {
945945
"Exit code $exitCode"
946946
}

0 commit comments

Comments
 (0)