powershell
Installation
SKILL.md
PowerShell Development Skill
Conventions and safety patterns for PowerShell scripts in scripts/ and CI.
Style and Linting
- Scripts in
Build/Agent/, and anything else reached frombuild.ps1ortest.ps1, must run under both Windows PowerShell 5.1 and PowerShell 7. CI executes the build and test steps under 5.1, so 6+-only syntax that parses cleanly on 7 can still fail or silently misbehave there: the backtick u{} escape resolves to literal text under 5.1 instead of a code point, and-Encoding utf8BOM/utf8NoBOMthrow a parameter-binding error. RunBuild/Agent/powershell-compat.ps1to check, and prefer syntax both engines share over anything PowerShell Core adds. - Use
Set-StrictMode -Version Latest. - Use
Write-Hostsparingly; preferWrite-OutputandWrite-Errorfor correct streams. - Use
-ErrorAction Stopin helper functions when errors should abort execution. - No Unicode icons or emojis in output messages (e.g.,
✓,✗,⚠,🔧). Use plain ASCII text like[OK],[FAIL],[WARN],ERROR:instead. Unicode causes encoding issues in CI logs.