ITADN

PowerJS fails to start if pwsh is not installed

#7Openrsmarples 创建于 2024-01-03
R
rsmarplescommented
child_process:spawn does not throw any error directly as it forks a process Instead, errors are emitted and need to be listened to. `error` is emitted on errors, and `spawn` on success. https://nodejs.org/api/child_process.html#event-error As such, only the first element of additionalShellNames is considered. Workaround for vanilla windows without PowerShell-7: ``` const psOptions = { additionalShellNames: ['powershell'], extensions: [], dlls: {} }; const ps = new PowerJS(psOptions); ```
2 条评论