MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / build_powershell_args

Function build_powershell_args

src/hooks/shell_invocation.py:36–51  ·  view source on GitHub ↗

Return the argv list for spawning ``pwsh`` with ``cmd``. Mirrors ``buildPowerShellArgs`` in ``typescript/src/utils/shell/powershellProvider.ts:11-13``: * ``-NoProfile`` — skip user profile scripts (faster, deterministic). * ``-NonInteractive`` — fail fast instead of prompting f

(cmd: str)

Source from the content-addressed store, hash-verified

34
35
36def build_powershell_args(cmd: str) -> list[str]:
37 """Return the argv list for spawning ``pwsh`` with ``cmd``.
38
39 Mirrors ``buildPowerShellArgs`` in
40 ``typescript/src/utils/shell/powershellProvider.ts:11-13``:
41
42 * ``-NoProfile`` — skip user profile scripts (faster, deterministic).
43 * ``-NonInteractive`` — fail fast instead of prompting for input.
44 * ``-Command`` — execute the literal string that follows.
45
46 The caller invokes ``asyncio.create_subprocess_exec(pwsh_path,
47 *build_powershell_args(cmd), ...)`` — explicit argv with no intervening
48 shell. This matches the TS ``spawn(pwshPath, buildPowerShellArgs(cmd),
49 ...)`` call at ``typescript/src/utils/hooks.ts:1108``.
50 """
51 return ["-NoProfile", "-NonInteractive", "-Command", cmd]
52
53
54def find_powershell_path() -> str | None:

Calls

no outgoing calls