Code tool calls fail with Powershell 7 installations from Windows Store or Winget

Open 💬 2 comments Opened Apr 25, 2026 by SlippyDong

What version of the IDE extension are you using?

26.5304.20706

What subscription do you have?

plus

Which IDE are you using?

vs code

What platform is your computer?

Windows 11 Pro

What issue are you seeing?

When powershell 7 is installed through windows store or winget, the default path for the installlocation is:

C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.1.0_x64__8wekyb3d8bbwe\pwsh.exe

When Codex tries to invoke tool calls using powershell the agent's terminal exits early and eventually runs a Get-Location which then gives a success response, after which the agent continues its tasks. The agent will then request elevated permissions to run some standard queries which fail in the sandbox but after seeing this in several fresh prompts I wondered what caused these failures and narrowed it down the how Powershell is installed on the system. When Powershell is installed with the MSI, the default installation path is in the Program Files folder and this resolved the tool call problems the agent had.

What steps can reproduce the bug?

  1. Install Powershell 7 through Windows Store or Winget
  2. Open VS CODE and provide a random task to the code agent on a random code base
  3. Watch the reasoning output and tool calls for exit codes that error - the agent will note that they fail and will try to fall back on MCP first and then run a Get-Location that succeeds.

What is the expected behavior?

  1. Check the current installlocation of Powrshell 7: Get-AppxPackage Microsoft.PowerShell
  2. If it returns empty, you're not using the Windows Store or Winget version, but if it returns something like:
Microsoft.PowerShell_7.6.1.0_x64__8wekyb3d8bbwe
InstallLocation : C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.1.0_x64__8wekyb3d8bbwe
IsFramework : False
PackageFamilyName : Microsoft.PowerShell_8wekyb3d8bbwe

This means Powershell is installed as a WindowsApp instead of a normal program and Codex may have trouble using it in tool calls.

Additional information

_No response_

View original on GitHub ↗

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