PowerShell MCP server uses PowerShell 5.1 instead of PowerShell 7
Resolved 💬 3 comments Opened Nov 15, 2025 by kat-bell Closed Jan 16, 2026
Issue Description
The PowerShell MCP server built into Claude Code uses the legacy powershell.exe (PowerShell 5.1) instead of pwsh.exe (PowerShell 7).
Impact
- PowerShell 5.1 is the legacy Windows PowerShell that ships with Windows
- PowerShell 7+ is the modern, cross-platform version with significant improvements
- Users who have PowerShell 7 installed expect it to be used by default
- This violates the principle of least surprise for users who have migrated to PowerShell 7
Evidence
Testing mcp__powershell__execute-powershell shows:
- PSVersion: 5.1.26100.7019
- PSEdition: Desktop (legacy edition)
- Expected: PSVersion 7.x, PSEdition: Core
Reproduction
- Install PowerShell 7 (pwsh.exe)
- Use any PowerShell MCP tool via
mcp__powershell__execute-powershell - Check
$PSVersionTable - Observe PowerShell 5.1 is being used instead of PowerShell 7
Expected Behavior
Claude Code should use pwsh.exe (PowerShell 7) when available, falling back to powershell.exe only if PowerShell 7 is not installed.
Environment
- OS: Windows 11
- Claude Code: 2.0.37
- PowerShell 7: Installed at C:\Program Files\PowerShell\7\pwsh.exe
- PowerShell 5.1: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Technical Details
The PowerShell executable path appears to be hardcoded in the Claude Code native binary (resources/native-binary/claude.exe) rather than being configurable.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗