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-code

Installs 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.Lengthif ($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

Recommended

More Debugging
1borghei avatardata-scientistborghei/claude-skillsData science across machine learning, statistical modeling, and experimentation. Use when selecting ML algorithms, engineering features, designing A/B tests, ev447skills.sh installs
2aj-geddes avatarthird-party-integrationaj-geddes/useful-ai-promptsIntegrate external APIs and services with error handling, retry logic, and data transformation. Use when connecting to payment processors, messaging services, a443skills.sh installs
3hkuds avatarcli-anything-lldbhkuds/cli-anythingStateful LLDB debugging via LLDB Python API439skills.sh installs
4secondsky avatarapi-response-optimizationsecondsky/claude-skillsOptimizes API performance through payload reduction, caching strategies, and compression techniques. Use when improving API response times, reducing bandwidth u434skills.sh installs
5personamanagmentlayer avatarpostgresql-expertpersonamanagmentlayer/pclExpert-level PostgreSQL database administration, advanced queries, performance tuning, and production operations425skills.sh installs
6tristanmanchester avatarstyling-nativewind-v4-expotristanmanchester/agent-skillsSets up and uses NativeWind v4 (Tailwind CSS v3) in Expo React Native apps, including Expo Router. Configures tailwind.config.js, global.css, babel.config.js (j420skills.sh installs