PowerShell Tool - Claude Code
Native PowerShell execution on Windows and optionally Unix hosts.
PowerShell Tool gives Claude first-class shell access on Windows without fighting cmd.exe or relying on WSL.
What it does
The tool runs PowerShell commands - cmdlets, scripts, pipelines - inside the session's working directory. It's the preferred shell on Windows and is available opt-in on macOS and Linux if you have PowerShell Core installed. Output is captured the same way the Bash tool handles it.
When to use it
- Windows-first development where PowerShell is native.
- Tasks involving .NET, Azure CLI, or other PowerShell-friendly tooling.
- Cross-platform scripts written in PowerShell.
- Avoiding POSIX-ism mismatches when Claude tries Unix-style commands on Windows.
Gotchas
- PowerShell Tool is preview on Windows - expect rough edges on obscure cmdlets.
- Execution policy may block scripts. Set it explicitly in your session if needed.
- Pipeline output differs from Bash - objects versus text - so don't assume awk/sed-style post-processing works.
Official docs: https://code.claude.com/docs/en/tools-reference.md#powershell-tool
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




