Powershell Windows
Reference guide of PowerShell pitfalls and patterns for writing Windows scripts reliably.
- CCM score
- 69 of 100
- skills.sh installs
- 456
- GitHub stars
- 34.3K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers operator syntax, Unicode restrictions, null checks, string interpolation, error handling, file paths, arrays, and JSON
- Includes tables of wrong versus correct patterns, an error-message lookup table, and a script template with strict mode and try/catch
- Enforces parenthesized cmdlet calls under logical operators, ASCII-only output, explicit
-Depthon JSON conversion, and null checks before access - Designed for developers writing or reviewing Windows PowerShell scripts who want to avoid common parsing and runtime failures
Install
$ npx -y skills add davila7/claude-code-templates --skill powershell-windows -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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 |
Details
- Repository
- github.com/davila7/claude-code-templates
- Categories
- CLI & Terminal, DevOps & Cloud
- First seen
- Jun 3, 2026
More from davila7/claude-code-templates
All 398- Langgraph447
- Autonomous Agent Patterns446
- Prompt Caching441
- Accessibility Auditor438
- Code Review Checklist438
- Nowait Reasoning Optimizer438
- Commit435
- Vercel Deployment434
- Information Security Manager Iso27001429
- Prompt Library426
- Statsmodels426
- Telegram Mini App423
- Pricing Strategy421
- Ml Paper Writing417
- Workflow Automation417
- Openalex Database416
- Shopify Development413
- Geopandas411
- Nextjs Supabase Auth411
- Clinicaltrials Database409
- Error Resolver409
- Bash Linux406
- Email Composer406
- Treatment Plans406
Similar to Powershell Windows
More CLI & Terminalbash-linuxdavila7/claude-code-templates406 installsBash and Linux terminal reference covering operators, file, process, text, and network commands with script safety patterns.
windows-path-troubleshootingjosiahsiegel/claude-plugin-marketplace202 installsPractical guide for fixing Windows path errors in Claude Code on Git Bash and native Windows.
powershell-masterjosiahsiegel/claude-plugin-marketplace1.2K installsComprehensive PowerShell guidance for cross-platform scripting, modules, CI/CD, and cloud automation.
shellpproenca/dot-skills718 installsShell scripting guide of 49 rules for safe, portable, and maintainable bash and POSIX sh scripts.
bash-scriptingmindrally/skills942 installsShell scripting conventions for secure, portable, and well-handled automation scripts in DevOps work.
bash-defensive-patternssickn33/agentic-awesome-skills319 installsDefensive Bash guidance for production scripts covering strict mode, input validation, safe file handling, and logging.