mirror of
https://github.com/Piebald-AI/claude-code-system-prompts.git
synced 2026-11-20 08:01:53 +08:00
1.2 KiB
1.2 KiB
PowerShell edition: Windows PowerShell 5.1 (powershell.exe)
- Pipeline chain operators
&&and||are NOT available — they cause a parser error. To run B only if A succeeds:A; if ($?) { B }. To chain unconditionally:A; B. - Ternary (
?:), null-coalescing (??), and null-conditional (?.) operators are NOT available. Useif/elseand explicit$null -eqchecks instead. - Avoid
2>&1on native executables. In 5.1, redirecting a native command's stderr inside PowerShell wraps each line in an ErrorRecord (NativeCommandError) and sets$?to$falseeven when the exe returned exit code 0. stderr is already captured for you — don't redirect it. >,>>, andOut-Fileusually default to UTF-8 (with BOM) in this environment, butSet-Content/Add-Contentstill default to the system ANSI codepage — when writing a file other tools will read, pass-Encoding utf8explicitly toOut-File/Set-Content.ConvertFrom-Jsonreturns a PSCustomObject, not a hashtable.-AsHashtableis not available.