copilot-cli
copilot-cli copied to clipboard
Support Windows PowerShell 5.1
Describe the feature or problem you'd like to solve
GitHub Copilot CLI currently requires PowerShell 6+ (pwsh), but the latest version of Windows 11 ships with Windows PowerShell 5.1 (version 5.1.26100.6899) as the default and only pre-installed PowerShell version. This creates an unnecessary barrier to entry for Windows users. The current error when attempting to use Copilot CLI on a default Windows installation is: PowerShell <exited with error: PowerShell 6+ (pwsh) is not available. Please install it from https://aka.ms/powershell. Error: Error: Command failed: pwsh.exe --version 'pwsh.exe' is not recognized as an internal or external command, operable program or batch file. > This version check is arbitrary the CLI works perfectly fine on PowerShell 5.1 with no issues. I know this as I made a quick proof of concept where I trick the program into thinking it is on such a version https://github.com/RespectMathias/pwsh-copilot.
Proposed solution
The CLI already works correctly on PowerShell 5.1. There are no features that actually require PowerShell 6+.
Example prompts or workflows
Current workflow (unnecessary friction): npm install -g @github/copilot Receive error about pwsh not being available Install PowerShell 7+ manually Finally use copilot
Proposed workflow (works immediately): npm install -g @github/copilot Use copilot immediately
Additional context
No response
I can confir that Copilot CLI agents are not usable because of this.
I also have this issue, which makes it unusable for me, since I use the built-in PowerShell provided by Windows 11 and don't want to install another version, especially because the built-in one works perfectly fine. i even added in the prompt that please use "powershell.exe" instead but ignores it
output of every command it tries to use:
✗ Create base directories
$ New-Item -ItemType Directory -Force -Path backend,frontend,shared | Out-Null; Write-Host "Created base directories"
<exited with error: PowerShell 6+ (pwsh) is not available. Please install it from https://aka.ms/powershell. Error: Error: Command failed: pwsh.exe --version
'pwsh.exe' is not recognized as an internal or external command,
operable program or batch file.
>
✗ Create base directories
$ mkdir -Force backend,frontend,shared; Write-Host "Created base directories"
<exited with error: PowerShell 6+ (pwsh) is not available. Please install it from https://aka.ms/powershell. Error: Error: Command failed: pwsh.exe --version
'pwsh.exe' is not recognized as an internal or external command,
operable program or batch file.
>
A workaround is starting PS6 or 7 terminal separately and using copilot there.