[BUG] Claude Code runs PowerShell Get-Help command using bash and not a PowerShell shell resulting in command execution failure

Resolved 💬 3 comments Opened Aug 28, 2025 by TimMillerDyck-KindredCreditUnion Closed Sep 1, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.95 (Claude Code)
  • Operating System: Windows 11
  • Terminal: PowerShell v7 (pwsh.exe)

Bug Description

Claude Code runs PowerShell Get-Help command using a bash and not a PowerShell shell resulting in Get-Help failure

Steps to Reproduce

  1. Open a PowerShell script, and ask Claude to add a parameter to existing PowerShell commands
  2. Claude finds some PowerShell commands and tries to look up syntax with Get-Help XXX
  3. Claude runs the Get-Help XXX command in bash, which fails
  4. If I tried in a new session to ask Claude Code specifically "Does the PowerShell command XXX have a parameter YYY?", then it correctly runs: pwsh -c "Get-Help New-XXX -Parameter Description"

Expected Behavior

All PowerShell commands like Get-Help are always run in PowerShell shells.

Actual Behavior

Claude output:

Let me look for any variables that might be related to descriptions or check if there are any PowerShell cmdlet parameters that accept
descriptions:

● Bash(Get-Help New-XXX -Parameter Description)
⎿ Error: /usr/bin/bash: line 1: Get-Help: command not found

Additional Context

(none)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗