gemini-cli - 💡(How to fix) Fix run_shell_command that generalist uses forces use of inappropriate powershell.exe rather than pwsh.exe [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
google-gemini/gemini-cli#25932Fetched 2026-04-25 06:22:11
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
1
Timeline (top)
commented ×1labeled ×1

Error Message

The "File not found" error persists because

Root Cause

The "File not found" error persists because
every time I try to run a command—even when I
specify the absolute path to your modern
binaries—the CLI's underlying wrapper attempts
to invoke powershell.exe -NoProfile -Command,
which appears to be missing or blocked in your
environment.

Fix Action

Fix / Workaround

gemini-cli and its sub-agents (particularly generalist) should use (or at least allow) use of PowerShell 7 (first released in March, 2020).

RAW_BUFFERClick to expand / collapse

What happened?

gemini-cli and its sub-agents (particularly generalist) should use (or at least allow) use of PowerShell 7 (first released in March, 2020).

Information from gemini-cli itself on the problem of the generalist sub-agent inability to do basic things: ✦ The choice of powershell.exe is not my own; it
is hardcoded into the built-in run_shell_command tool of the Gemini CLI application (v0.39.0). As a guest agent operating within this CLI, I do
not have the ability to modify the CLI's own
source code or its core execution engine to swap the legacy shell for pwsh.exe or llmbash.exe.

The "File not found" error persists because
every time I try to run a command—even when I
specify the absolute path to your modern
binaries—the CLI's underlying wrapper attempts
to invoke powershell.exe -NoProfile -Command,
which appears to be missing or blocked in your
environment.

Technical Conflict

  • Gemini CLI Core: Hardcoded to use powershell.exe.
  • Your Environment: Standardized on pwsh.exe and llmbash.exe.
  • Result: I am currently "execution-locked" because my only path to the CPU is through a binary (powershell.exe) that does not exist on your system.

What did you expect to happen?

the modern Powershell v7 should be usable. Generalst cannot even execute an executable I built that provides GO for bash commands.

Client information

<details> About Gemini CLI │ │ │ │ CLI Version 0.39.0 │ │ Git Commit 398f78dca │ │ Model gemini-3-flash-preview │ │ Sandbox no sandbox │ │ OS win32 │ │ Auth Method Signed in with Google │ │ xxxx │ ) │ │ Tier Gemini Code Assist in Google One │ │ AI Pro │ │ GCP Project velocikey-rnd │ │ IDE Client Antigravity </details>

Login information

logging in with google account (auth)

Anything else we need to know?

This bug must be impacting many, many companiers.

extent analysis

TL;DR

Update the Gemini CLI to use PowerShell 7 by modifying the hardcoded powershell.exe reference in the run_shell_command tool to support pwsh.exe.

Guidance

  • Identify the run_shell_command tool in the Gemini CLI source code and locate the hardcoded powershell.exe reference.
  • Consider modifying this reference to use pwsh.exe or adding an option to specify the shell executable.
  • Verify that the modified CLI can successfully execute commands using PowerShell 7.
  • If modifying the CLI source code is not feasible, explore alternative solutions, such as creating a wrapper script that invokes pwsh.exe instead of powershell.exe.

Example

No code snippet is provided as the issue does not contain sufficient information about the Gemini CLI source code.

Notes

The solution may require modifying the Gemini CLI source code, which could be complex and may have unintended consequences. It is essential to thoroughly test any modifications to ensure they do not introduce new issues.

Recommendation

Apply a workaround by modifying the Gemini CLI source code to support pwsh.exe, as updating to a fixed version is not mentioned in the issue. This approach allows for a potential solution while acknowledging the complexity of modifying the CLI source code.

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