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);
child_process:spawn does not throw any error directly as it forks a process
Instead, errors are emitted and need to be listened to.
erroris emitted on errors, andspawnon 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: