
Powershell Windows
PowerShell's syntax can bite you in ways other shells don't, and this skill exists to prevent those bites. It covers the critical gotchas like mandatory parentheses around cmdlets when using logical operators, the strict ASCII-only requirement that breaks if you use emoji or Unicode, and null checking patterns that prevent runtime explosions. You also get error handling conventions, the essential Depth parameter for JSON operations, and a clean script template. If you're working with Windows automation or find yourself debugging cryptic "unexpected token" errors, this reference cuts through the trial and error. It's the distilled pain of everyone who learned PowerShell the hard way.
- skills.sh installs
- 454
- GitHub stars
- 33.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add davila7/claude-code-templates --skill powershell-windows --agent claude-codeInstalls into .claude/skills of the current project.
Files
PowerShell Windows Patterns
Critical patterns and pitfalls for Windows PowerShell.
1. Operator Syntax Rules
CRITICAL: Parentheses Required
| ❌ Wrong | ✅ Correct |
|---|---|
if (Test-Path "a" -or Test-Path "b") | if ((Test-Path "a") -or (Test-Path "b")) |
if (Get-Item $x -and $y -eq 5) | if ((Get-Item $x) -and ($y -eq 5)) |
Rule: Each cmdlet call MUST be in parentheses when using logical operators.
2. Unicode/Emoji Restriction
CRITICAL: No Unicode in Scripts
| Purpose | ❌ Don't Use | ✅ Use |
|---|---|---|
| Success | ✅ ✓ | [OK] [+] |
| Error | ❌ ✗ 🔴 | [!] [X] |
| Warning | ⚠️ 🟡 | [*] [WARN] |
| Info | ℹ️ 🔵 | [i] [INFO] |
| Progress | ⏳ | [...] |
Rule: Use ASCII characters only in PowerShell scripts.
3. Null Check Patterns
Always Check Before Access
| ❌ Wrong | ✅ Correct |
|---|---|
$array.Count -gt 0 | $array -and $array.Count -gt 0 |
$text.Length | if ($text) { $text.Length } |
4. String Interpolation
Complex Expressions
| ❌ Wrong | ✅ Correct |
|---|---|
"Value: $($obj.prop.sub)" | Store in variable first |
Sponsors
Details
- Repository
- github.com/davila7/claude-code-templates
- Category
- Debugging
- First seen
- Jun 3, 2026
More from davila7/claude-code-templates
All 618- React Useeffect454
- Backend Patterns452
- Find Bugs447
- Langgraph447
- Agent Md Refactor446
- Autonomous Agent Patterns446
- D3 Viz445
- Manim444
- Marketing Psychology443
- Requirements Clarity442
- Frontend To Backend Requirements441
- Canvas Design439
- Nowait Reasoning Optimizer438
- Code Review Checklist437
- Prompt Caching437
- Commit435
- Vercel Deployment433
- C4 Architecture430
- Information Security Manager Iso27001428
- Mlflow427
- Statsmodels426
- Prompt Library423
- Chroma421
- Telegram Mini App420