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)
| 34 | |
| 35 | |
| 36 | def 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 | |
| 54 | def find_powershell_path() -> str | None: |
no outgoing calls