X Tutup
The Wayback Machine - https://web.archive.org/web/20201126145544/https://github.com/PowerShell/PowerShell/issues/13083
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PowerShell available for npm installation. #13083

Open
aetos382 opened this issue Jul 2, 2020 · 3 comments
Open

Make PowerShell available for npm installation. #13083

aetos382 opened this issue Jul 2, 2020 · 3 comments

Comments

@aetos382
Copy link
Contributor

@aetos382 aetos382 commented Jul 2, 2020

Summary of the new feature/enhancement

I want to do the following.

  • I can install and run PowerShell in the current user scope with the following commands.
npm install -g @microsoft/powershell
pwsh
  • I can install and run PowerShell in current directory with the following commands.
npm install -D @microsoft/powershell
npx pwsh
  • I can use PowerShell immediately by cloning the repository from Git with the following commands.
git clone <repo-url>
cd <repo-dir>
npm install
npx pwsh
{
  "script": {
    "clean": "Remove-Item ./output -Recursive"
  }
}

By default, the commands in the npm script are executed using the native OS shell (cmd on Windows, bash on Linux).
Therefore, the same commands cannot be used on Windows and Linux.
We can use npm modules to absorb OS differences, but it's more natural to write them in the shell's native language.

So I think it is useful to be able to write the npm scripts in PowerShell.
The shell that runs the npm scripts can be configured in a .npmrc file. It can be placed in a project directory.

Similarly, PowerShell can be installed as a dotnet Global Tool.
In this case, the .NET Core SDK must be installed first, and the .NET Core SDK cannot be installed with platform-independent commands (PowerShell is required to use the dotnet-install.ps1 script).

@iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Jul 2, 2020

@kilasuit
Copy link
Contributor

@kilasuit kilasuit commented Jul 2, 2020

theres this - https://rannn505.github.io/node-powershell/

does that help at all?

Easily run PowerShell from your NodeJS app
@aetos382
Copy link
Contributor Author

@aetos382 aetos382 commented Jul 3, 2020

@kilasuit No. It's a module to call PowerShell from NodeJS, PowerShell needs to be installed separately.

My suggestion is on how to install PowerShell itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.
X Tutup