What problem does it solve? AI agents running shell commands on Windows frequently corrupt files, hang on interactive prompts, or hit parse errors because Windows PowerShell 5.1 behaves differently from Unix shells and PowerShell 7. This Skill prevents encoding corruption, silent failures, and blocked tool calls by encoding measured, verified rules for the Windows shell environment. ## Core Features & Use Cases - PowerShell 5.1 Parser Limits: Documents which constructs (&&, ||, ternary, null-coalescing, ?.) are parse errors or silently wrong, with correct replacements. - Safe File I/O: Provides .NET-based patterns for BOM-less UTF-8 reads/writes, CRLF/LF line-ending handling, and in-place text replacement without redirection operators. - Native Command & Hang Prevention: Covers $LASTEXITCODE checks, stderr redirect crashes, non-interactive execution rules, and Unix-to-PowerShell command equivalents. - Use Case: An agent needs to edit a JSON config file on Windows. Instead of piping ConvertTo-Json to Set-Content (which truncates nested objects at depth 2 and adds a BOM), it follows the Skill's pattern: ConvertTo-Json -Depth 100 written via [System.IO.File]::WriteAllText with UTF8Encoding($false). ## Quick Start Apply the PowerShell guidelines whenever you run terminal commands or write files on Windows, and follow its encoding and quoting rules for every command you execute.