{"id":"65a51061-c45d-4f7c-a223-75c515cc878b","shortId":"W4cPXg","kind":"skill","title":"Powershell Windows","tagline":"Antigravity Awesome Skills skill by Sickn33","description":"# PowerShell Windows Patterns\n\n> Critical patterns and pitfalls for Windows PowerShell.\n\n---\n\n## 1. Operator Syntax Rules\n\n### CRITICAL: Parentheses Required\n\n| ❌ Wrong | ✅ Correct |\n|----------|-----------|\n| `if (Test-Path \"a\" -or Test-Path \"b\")` | `if ((Test-Path \"a\") -or (Test-Path \"b\"))` |\n| `if (Get-Item $x -and $y -eq 5)` | `if ((Get-Item $x) -and ($y -eq 5))` |\n\n**Rule:** Each cmdlet call MUST be in parentheses when using logical operators.\n\n---\n\n## 2. Unicode/Emoji Restriction\n\n### CRITICAL: No Unicode in Scripts\n\n| Purpose | ❌ Don't Use | ✅ Use |\n|---------|-------------|--------|\n| Success | ✅ ✓ | [OK] [+] |\n| Error | ❌ ✗ 🔴 | [!] [X] |\n| Warning | ⚠️ 🟡 | [*] [WARN] |\n| Info | ℹ️ 🔵 | [i] [INFO] |\n| Progress | ⏳ | [...] |\n\n**Rule:** Use ASCII characters only in PowerShell scripts.\n\n---\n\n## 3. Null Check Patterns\n\n### Always Check Before Access\n\n| ❌ Wrong | ✅ Correct |\n|----------|-----------|\n| `$array.Count -gt 0` | `$array -and $array.Count -gt 0` |\n| `$text.Length` | `if ($text) { $text.Length }` |\n\n---\n\n## 4. String Interpolation\n\n### Complex Expressions\n\n| ❌ Wrong | ✅ Correct |\n|----------|-----------|\n| `\"Value: $($obj.prop.sub)\"` | Store in variable first |\n\n**Pattern:**\n```\n$value = $obj.prop.sub\nWrite-Output \"Value: $value\"\n```\n\n---\n\n## 5. Error Handling\n\n### ErrorActionPreference\n\n| Value | Use |\n|-------|-----|\n| Stop | Development (fail fast) |\n| Continue | Production scripts |\n| SilentlyContinue | When errors expected |\n\n### Try/Catch Pattern\n\n- Don't return inside try block\n- Use finally for cleanup\n- Return after try/catch\n\n---\n\n## 6. File Paths\n\n### Windows Path Rules\n\n| Pattern | Use |\n|---------|-----|\n| Literal path | `C:\\Users\\User\\file.txt` |\n| Variable path | `Join-Path $env:USERPROFILE \"file.txt\"` |\n| Relative | `Join-Path $ScriptDir \"data\"` |\n\n**Rule:** Use Join-Path for cross-platform safety.\n\n---\n\n## 7. Array Operations\n\n### Correct Patterns\n\n| Operation | Syntax |\n|-----------|--------|\n| Empty array | `$array = @()` |\n| Add item | `$array += $item` |\n| ArrayList add | `$list.Add($item) | Out-Null` |\n\n---\n\n## 8. JSON Operations\n\n### CRITICAL: Depth Parameter\n\n| ❌ Wrong | ✅ Correct |\n|----------|-----------|\n| `ConvertTo-Json` | `ConvertTo-Json -Depth 10` |\n\n**Rule:** Always specify `-Depth` for nested objects.\n\n### File Operations\n\n| Operation | Pattern |\n|-----------|---------|\n| Read | `Get-Content \"file.json\" -Raw | ConvertFrom-Json` |\n| Write | `$data | ConvertTo-Json -Depth 10 | Out-File \"file.json\" -Encoding UTF8` |\n\n---\n\n## 9. Common Errors\n\n| Error Message | Cause | Fix |\n|---------------|-------|-----|\n| \"parameter 'or'\" | Missing parentheses | Wrap cmdlets in () |\n| \"Unexpected token\" | Unicode character | Use ASCII only |\n| \"Cannot find property\" | Null object | Check null first |\n| \"Cannot convert\" | Type mismatch | Use .ToString() |\n\n---\n\n## 10. Script Template\n\n```powershell\n# Strict mode\nSet-StrictMode -Version Latest\n$ErrorActionPreference = \"Continue\"\n\n# Paths\n$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path\n\n# Main\ntry {\n    # Logic here\n    Write-Output \"[OK] Done\"\n    exit 0\n}\ncatch {\n    Write-Warning \"Error: $_\"\n    exit 1\n}\n```\n\n---\n\n> **Remember:** PowerShell has unique syntax rules. Parentheses, ASCII-only, and null checks are non-negotiable.\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.","tags":["powershell","windows","antigravity","awesome","skills","sickn33"],"capabilities":["skill","source-sickn33","category-antigravity-awesome-skills"],"categories":["antigravity-awesome-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/powershell-windows","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under sickn33/antigravity-awesome-skills","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-25T11:40:38.262Z","embedding":null,"createdAt":"2026-04-18T20:31:28.861Z","updatedAt":"2026-04-25T11:40:38.262Z","lastSeenAt":"2026-04-25T11:40:38.262Z","tsv":"'0':122,127,358 '1':19,365 '10':259,286,328 '2':78 '3':110 '4':132 '5':56,65,153 '6':185 '7':223 '8':244 '9':293 'access':117 'action':395 'add':233,238 'alway':114,261 'antigrav':3 'applic':389 'array':123,224,231,232,235 'array.count':120,125 'arraylist':237 'ascii':104,312,374 'ascii-on':373 'ask':433 'awesom':4 'b':37,47 'block':177 'boundari':441 'c':195 'call':69 'cannot':314,322 'catch':359 'category-antigravity-awesome-skills' 'caus':298 'charact':105,310 'check':112,115,319,378 'clarif':435 'cleanup':181 'clear':408 'cmdlet':68,305 'common':294 'complex':135 'content':274 'continu':163,340 'convert':323 'convertfrom':278 'convertfrom-json':277 'convertto':253,256,283 'convertto-json':252,255,282 'correct':27,119,138,226,251 'criteria':444 'critic':12,23,81,247 'cross':220 'cross-platform':219 'data':212,281 'depth':248,258,263,285 'describ':396,412 'develop':160 'done':356 'empti':230 'encod':291 'env':204 'environ':424 'environment-specif':423 'eq':55,64 'error':93,154,168,295,296,363 'erroractionprefer':156,339 'execut':391 'exit':357,364 'expect':169 'expert':429 'express':136 'fail':161 'fast':162 'file':186,267,289 'file.json':275,290 'file.txt':198,206 'final':179 'find':315 'first':144,321 'fix':299 'get':50,59,273 'get-cont':272 'get-item':49,58 'gt':121,126 'handl':155 'info':97,100 'input':438 'insid':175 'interpol':134 'item':51,60,234,236,240 'join':202,209,216 'join-path':201,208,215 'json':245,254,257,279,284 'latest':338 'limit':400 'list.add':239 'liter':193 'logic':76,350 'main':348 'match':409 'messag':297 'mismatch':325 'miss':302,446 'mode':333 'must':70 'myinvocation.mycommand.path':347 'negoti':382 'nest':265 'non':381 'non-negoti':380 'null':111,243,317,320,377 'obj.prop.sub':140,147 'object':266,318 'ok':92,355 'oper':20,77,225,228,246,268,269 'out-fil':287 'out-nul':241 'output':150,354,418 'overview':399 'paramet':249,300 'parent':346 'parenthes':24,73,303,372 'path':31,36,41,46,187,189,194,200,203,210,217,341,345 'pattern':11,13,113,145,171,191,227,270 'permiss':439 'pitfal':15 'platform':221 'powershel':1,9,18,108,331,367 'product':164 'progress':101 'properti':316 'purpos':86 'raw':276 'read':271 'relat':207 'rememb':366 'requir':25,437 'restrict':80 'return':174,182 'review':430 'rule':22,66,102,190,213,260,371 'safeti':222,440 'scope':411 'script':85,109,165,329 'scriptdir':211,342 'set':335 'set-strictmod':334 'sickn33':8 'silentlycontinu':166 'skill':5,6,387,403 'source-sickn33' 'specif':425 'specifi':262 'split':344 'split-path':343 'stop':159,431 'store':141 'strict':332 'strictmod':336 'string':133 'substitut':421 'success':91,443 'syntax':21,229,370 'task':407 'templat':330 'test':30,35,40,45,427 'test-path':29,34,39,44 'text':130 'text.length':128,131 'token':308 'tostr':327 'treat':416 'tri':176,349 'try/catch':170,184 'type':324 'unexpect':307 'unicod':83,309 'unicode/emoji':79 'uniqu':369 'use':75,89,90,103,158,178,192,214,311,326,385,401 'user':196,197 'userprofil':205 'utf8':292 'valid':426 'valu':139,146,151,152,157 'variabl':143,199 'version':337 'warn':95,96,362 'window':2,10,17,188 'workflow':393 'wrap':304 'write':149,280,353,361 'write-output':148,352 'write-warn':360 'wrong':26,118,137,250 'x':52,61,94 'y':54,63 'ℹ️':98","prices":[{"id":"cadc8056-1a21-4459-9c6e-d677a804d4a8","listingId":"65a51061-c45d-4f7c-a223-75c515cc878b","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"sickn33","category":"antigravity-awesome-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:31:28.861Z"}],"sources":[{"listingId":"65a51061-c45d-4f7c-a223-75c515cc878b","source":"github","sourceId":"sickn33/antigravity-awesome-skills/powershell-windows","sourceUrl":"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/powershell-windows","isPrimary":false,"firstSeenAt":"2026-04-18T21:42:38.050Z","lastSeenAt":"2026-04-25T06:51:44.867Z"},{"listingId":"65a51061-c45d-4f7c-a223-75c515cc878b","source":"skills_sh","sourceId":"sickn33/antigravity-awesome-skills/powershell-windows","sourceUrl":"https://skills.sh/sickn33/antigravity-awesome-skills/powershell-windows","isPrimary":true,"firstSeenAt":"2026-04-18T20:31:28.861Z","lastSeenAt":"2026-04-25T11:40:38.262Z"}],"details":{"listingId":"65a51061-c45d-4f7c-a223-75c515cc878b","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"sickn33","slug":"powershell-windows","source":"skills_sh","category":"antigravity-awesome-skills","skills_sh_url":"https://skills.sh/sickn33/antigravity-awesome-skills/powershell-windows"},"updatedAt":"2026-04-25T11:40:38.262Z"}}