Expand description
Command semantics configuration for interpreting exit codes in PowerShell.
PowerShell-native cmdlets do NOT need exit-code semantics:
- Select-String (grep equivalent) exits 0 on no-match (returns $null)
- Compare-Object (diff equivalent) exits 0 regardless
- Test-Path exits 0 regardless (returns bool via pipeline) Native cmdlets signal failure via terminating errors ($?), not exit codes.
However, EXTERNAL executables invoked from PowerShell DO set $LASTEXITCODE, and many use non-zero codes to convey information rather than failure:
- grep.exe / rg.exe (Git for Windows, scoop, etc.): 1 = no match
- findstr.exe (Windows native): 1 = no match
- robocopy.exe (Windows native): 0-7 = success, 8+ = error (notorious!)
Structs§
- Command
Result - Result of command interpretation
Enums§
- Command
Type - Command type identifier for lookup
Functions§
- interpret_
command_ result - Interpret command result based on semantic rules