Install any skill in seconds. Free to start, no credit card required.
Get Started Free →PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling.
.claude/skills/davila7-powershell-windows/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 2% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 207% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 86% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 58% | 0% |
> Critical patterns and pitfalls for Windows PowerShell.
| ❌ 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.
| Purpose | ❌ Don't Use | ✅ Use | |---------|-------------|--------| | Success | ✅ ✓ | OK] +] | | Error | ❌ ✗ 🔴 | !] X] | | Warning | ⚠️ 🟡 | ] WARN] | | Info | ℹ️ 🔵 | i] INFO] | | Progress | ⏳ | ...] |
Rule: Use ASCII characters only in PowerShell scripts.
| ❌ Wrong | ✅ Correct | |----------|-----------| | $array.Count -gt 0 | $array -and $array.Count -gt 0 | | $text.Length | if ($text) { $text.Length } |
| ❌ Wrong | ✅ Correct | |----------|-----------| | "Value: $($obj.prop.sub)" | Store in variable first |
Pattern:
$value = $obj.prop.sub
Write-Output "Value: $value"| Value | Use | |-------|-----| | Stop | Development (fail fast) | | Continue | Production scripts | | SilentlyContinue | When errors expected |
| Pattern | Use | |---------|-----| | Literal path | C:\Users\User\file.txt | | Variable path | Join-Path $env:USERPROFILE "file.txt" | | Relative | Join-Path $ScriptDir "data" |
Rule: Use Join-Path for cross-platform safety.
| Operation | Syntax | |-----------|--------| | Empty array | $array = @() | | Add item | $array += $item | | ArrayList add | $list.Add($item) | Out-Null |
| ❌ Wrong | ✅ Correct | |----------|-----------| | ConvertTo-Json | ConvertTo-Json -Depth 10 |
Rule: Always specify -Depth for nested objects.
| Operation | Pattern | |-----------|---------| | Read | Get-Content "file.json" -Raw | ConvertFrom-Json | | Write | $data | ConvertTo-Json -Depth 10 | Out-File "file.json" -Encoding UTF8 |
| Error Message | Cause | Fix | |---------------|-------|-----| | "parameter 'or'" | Missing parentheses | Wrap cmdlets in () | | "Unexpected token" | Unicode character | Use ASCII only | | "Cannot find property" | Null object | Check null first | | "Cannot convert" | Type mismatch | Use .ToString() |
powershell# Strict mode Set-StrictMode -Version Latest $ErrorActionPreference = "Continue" # Paths $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path # Main try { # Logic here Write-Output "[OK] Done" exit 0 } catch { Write-Warning "Error: $_" exit 1 }
> Remember: PowerShell has unique syntax rules. Parentheses, ASCII-only, and null checks are non-negotiable.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 8,432 | 7,850 | -7% | 1 | 1 | 0% | 1,597 | 2,482 | +55% | 0 | 0 | — |
case-01 | pass→pass | 22,852 | 17,589 | -23% | 1 | 1 | 0% | 4,119 | 4,604 | +12% | 0 | 0 | — |
case-02 | fail→pass | 15,180 | 10,188 | -33% | 1 | 1 | 0% | 2,471 | 2,937 | +19% | 0 | 0 | — |
case-03 | fail→fail | 17,351 | 15,192 | -12% | 1 | 1 | 0% | 3,288 | 3,876 | +18% | 0 | 0 | — |
case-05 | pass→pass | 6,575 | 3,919 | -40% | 1 | 1 | 0% | 1,137 | 1,729 | +52% | 0 | 0 | — |
case-06 | fail→pass | 9,495 | 3,662 | -61% | 1 | 1 | 0% | 1,564 | 1,599 | +2% | 0 | 0 | — |
case-07 | fail→pass | 4,142 | 5,053 | +22% | 1 | 1 | 0% | 616 | 1,894 | +207% | 0 | 0 | — |
case-08 | pass→pass | 6,481 | 4,898 | -24% | 1 | 1 | 0% | 1,101 | 1,713 | +56% | 0 | 0 | — |
case-09 | pass→pass | 8,180 | 5,730 | -30% | 1 | 1 | 0% | 1,297 | 1,923 | +48% | 0 | 0 | — |
case-10 | fail→pass | 5,808 | 5,066 | -13% | 1 | 1 | 0% | 1,021 | 1,899 | +86% | 0 | 0 | — |
case-11 | pass→pass | 11,244 | 7,049 | -37% | 1 | 1 | 0% | 1,995 | 2,183 | +9% | 0 | 0 | — |
case-12 | fail→pass | 16,034 | 19,625 | +22% | 1 | 1 | 0% | 2,970 | 4,702 | +58% | 0 | 0 | — |
case-13 | fail→pass | 17,137 | 11,747 | -31% | 1 | 1 | 0% | 3,368 | 3,145 | -7% | 0 | 0 | — |
case-14 | pass→pass | 6,996 | 10,757 | +54% | 1 | 1 | 0% | 1,160 | 1,921 | +66% | 0 | 0 | — |
case-15 | pass→pass | 3,351 | 3,098 | -8% | 1 | 1 | 0% | 502 | 1,513 | +201% | 0 | 0 | — |
case-16 | pass→pass | 5,407 | 4,367 | -19% | 1 | 1 | 0% | 904 | 1,653 | +83% | 0 | 0 | — |
case-17 | pass→pass | 5,416 | 6,568 | +21% | 1 | 1 | 0% | 1,041 | 2,378 | +128% | 0 | 0 | — |
case-18 | fail→pass | 13,110 | 5,913 | -55% | 1 | 1 | 0% | 1,439 | 1,911 | +33% | 0 | 0 | — |
case-19 | pass→pass | 11,207 | 11,416 | +2% | 1 | 1 | 0% | 1,939 | 2,992 | +54% | 0 | 0 | — |
case-20 | pass→pass | 7,427 | 6,574 | -11% | 1 | 1 | 0% | 1,300 | 2,240 | +72% | 0 | 0 | — |
case-21 | pass→pass | 5,942 | 5,034 | -15% | 1 | 1 | 0% | 1,005 | 1,898 | +89% | 0 | 0 | — |
case-22 | pass→pass | 4,094 | 4,088 | -0% | 1 | 1 | 0% | 583 | 1,680 | +188% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.