Skip to content

Windows Shell falls back to cmd.exe when launched from PowerShell 7 (pwsh.exe) #750

Closed

Description

@philippeback

Summary

When cecli is launched from PowerShell 7 (pwsh.exe) on Windows, Shell commands fall back to cmd.exe (shell=True) instead of PowerShell, causing PowerShell cmdlets (Get-ChildItem, Get-Content, ls, etc.) to fail.

Root Cause

In cecli/run_cmd.py, get_windows_parent_process_name() walks up the process tree looking only for "powershell.exe" (Windows PowerShell 5.1) and "cmd.exe". It misses "pwsh.exe" (PowerShell 7), so it returns None and both run_cmd_subprocess and run_cmd_async fall back to cmd.exe.

Expected Behavior

Detect pwsh.exe in get_windows_parent_process_name() and route commands through pwsh -NoProfile -NonInteractive -OutputFormat Text -EncodedCommand ... just as powershell.exe routes through powershell.

Activity

  1. added a commit that references this issue on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions