Copilot shell on windows errors #187164
Replies: 5 comments 1 reply
-
|
Hello! It is incredibly frustrating when a tool tells you something isn't installed when you know for a fact that it is. The reason this is happening is due to how the Copilot CLI runs in the background. It uses a background process (Node.js) to try and spawn Here is exactly how to fix this so Copilot can see your PowerShell 7 installation: Step 1: Find where PowerShell 7 is installed Step 2: Add it to your Windows PATH
Step 3: The crucial final step Once you restart and run the Copilot shell again, it will successfully find |
Beta Was this translation helpful? Give feedback.
-
|
The error happens because Copilot shell is looking for PowerShell 7 installs to To fix it:
You can verify it's working by opening a new terminal and running If PowerShell 7 isn't installed at all, grab it from the Microsoft Store or the GitHub releases page for PowerShell, the Store version handles PATH automatically. |
Beta Was this translation helpful? Give feedback.
-
|
The error indicates that pwsh.exe (PowerShell 6+) is either not installed correctly or not available in the system’s PATH, even though a version of PowerShell may be present on the machine. GitHub tools that rely on pwsh expect PowerShell 7+ to be properly installed and accessible via PATH. If pwsh --version works in your terminal but fails when invoked by the tool, it’s likely an environment/path configuration issue rather than a platform-wide problem. Suggested steps: Ensure PowerShell 7+ is installed from the official source. We regularly test on Windows environments, but configurations can vary between systems. If the issue persists, please share additional details about your setup so we can investigate further. |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, this is honestly pretty frustrating. The weird part is that the error literally says What’s surprising is that this is happening across multiple Windows machines. You’d expect something this basic to have been caught already if the feature is meant to support Windows properly. It really does feel like the developers mostly test on macOS/Linux sometimes. A quick workaround is usually adding the PowerShell 7 install directory to PATH manually. On most systems it’s something like:
After adding that, restarting the terminal/VS Code usually fixes it. Still, users really shouldn’t have to do this manually in 2026. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @kokosinkaeleno-cell! I feel your pain. It’s a bit of a "Windows tax" that the tool shows you the version you have installed but then claims it can't find it. The reason this is happening on "every Windows PC" is usually because GitHub Copilot for CLI specifically calls The most reliable fix (without clicking through 10 menus) is to run this one-liner in an Admin PowerShell window: [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\PowerShell\7\", "Machine")
Why this actually works:
Important: You must restart VS Code or your terminal completely after running that command for the changes to take effect. Give that a shot—it should clear the error across all your machines! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Copilot Feature Area
General
Body
<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.
pwsh.exe --version
PowerShell 7.5.4
its happening on every windows pc I try to run on. How can this happen on such system? Is noone from developers using it on windows?
Beta Was this translation helpful? Give feedback.
All reactions