# powershell-windows

Defines patterns for Windows PowerShell scripts, enforcing cmdlet parentheses, pure ASCII console output, and safe JSON parsing. Solves common syntax crashes.

- skill · `type=skill` · Claude Code · 169 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/powershell-windows
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/powershell-windows

## What it does

This skill guides Claude Code to write reliable PowerShell scripts tailored for Windows environments. It focuses on resolving interpreter syntax quirks. When combining cmdlet calls with `-and` or `-or`, each cmdlet must be wrapped in parentheses. If skipped, PowerShell halts parsing. Complex object properties must be stored in standalone variables before string interpolation, and every object requires a `$null` check before property access.

Emojis are banned across script outputs. Using them triggers unexpected token errors in standard Windows shells. The skill replaces them with clean ASCII indicators like `[OK]` or `[WARN]`. Scripts also follow a strict baseline: running `Set-StrictMode`, setting execution preferences, handling errors via `try/catch` without early returns, and constructing directories through `Join-Path`.

Calling `ConvertTo-Json` without the `-Depth` parameter silently truncates nested data structures. The assistant utilizes tools like `Read`, `Write`, `Edit`, `Glob`, `Grep`, and `Bash` to inspect and modify project scripts.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill development/powershell-windows
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill powershell-windows -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/powershell-windows/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/powershell-windows/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/powershell-windows/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/powershell-windows/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates powershell-windows
```

2. **Manually: put the files in place**
- File: `.github/skills/powershell-windows/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/powershell-windows
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/powershell-windows/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/development/powershell-windows

## When to use it
- Eliminate syntax errors caused by unparenthesized cmdlets in `-and` or `-or` checks
- Prevent unexpected token crashes by replacing Unicode emojis with ASCII tags
- Preserve nested data when exporting objects with `ConvertTo-Json`
- Scaffold boilerplate scripts using `Set-StrictMode` and structured error handling

## Example prompts
- Write a PowerShell script that parses `settings.json` and reports service health
- Inspect `backup.ps1` for null-reference issues and missing cmdlet parentheses
- Generate a template script using `Join-Path` and try-catch exit codes

## Similar
- [migrate-to-shoehorn](https://affpapa.org/en/nevibecode/skills/migrate-to-shoehorn.md) — skill · 475388 installs
- [write-swift](https://affpapa.org/en/nevibecode/skills/write-swift.md) — skill · 119300 installs
- [megacave](https://affpapa.org/en/nevibecode/skills/megacave.md) — skill · 25400 installs
- [find-docs](https://affpapa.org/en/nevibecode/skills/find-docs.md) — skill · 9400 installs
- [typescript-advanced-types](https://affpapa.org/en/nevibecode/skills/typescript-advanced-types.md) — skill · 92169 installs
- [smart-explore](https://affpapa.org/en/nevibecode/skills/smart-explore.md) — skill · 7300 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
