Skip to content

PowerJS fails to start if pwsh is not installed #7

Description

@rsmarples

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions