Use GitHub Copilot CLI in PowerShell 5.1 on Windows.
npm i -g pwsh-copilotpwsh --version # PowerShell 7.5.4 (shim output)
$PSVersionTable.PSVersion # Actual PowerShell versionnpm rm -g pwsh-copilot
Remove-Item "$env:APPDATA\npm\pwsh.exe" -ErrorAction SilentlyContinue # Remove leftover shim- Installs GitHub Copilot CLI (
@github/copilot) - Fakes
pwsh --version→ printsPowerShell 7.5.4 - Forwards all other arguments to the system’s
powershell.exe
MIT License © 2025 Mathias Lund-Hansen