codex - 💡(How to fix) Fix Code tool calls fail with Powershell 7 installations from Windows Store or Winget [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19550Fetched 2026-04-26 05:15:18
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Error Message

  1. 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.

Code Example

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

---

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
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Install PowerShell 7 using the MSI installer to resolve the issue with Codex tool calls.

Guidance

  • The problem is likely caused by the installation location of PowerShell 7 when installed through the Windows Store or Winget, which is in the C:\Program Files\WindowsApps directory.
  • To verify, check the installation location of PowerShell 7 using the command Get-AppxPackage Microsoft.PowerShell and look for the InstallLocation field.
  • If the installation location is in the WindowsApps directory, uninstall PowerShell 7 and reinstall it using the MSI installer to change the installation location to the Program Files directory.
  • This should resolve the issue with Codex tool calls failing due to the non-standard installation location of PowerShell 7.

Example

No code snippet is necessary for this issue, as it is related to the installation location of PowerShell 7.

Notes

This solution assumes that the issue is indeed caused by the installation location of PowerShell 7. If the issue persists after reinstalling PowerShell 7 using the MSI installer, further troubleshooting may be necessary.

Recommendation

Apply workaround: Install PowerShell 7 using the MSI installer, as this changes the installation location to the Program Files directory, which is compatible with Codex tool calls.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Code tool calls fail with Powershell 7 installations from Windows Store or Winget [1 comments, 2 participants]