JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39158
  • Score
    100M100P100Q143173F
  • License MIT

Lightweight module to run PowerShell straight from your Node app

Package Exports

  • node-powershell

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-powershell) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Node-PowerShell

Lightweight module to run PowerShell straight from your Node app

Installation

$ npm install node-powershell

Quick start

var ps = require('node-powershell');

Shell = ps("echo node-powershell is awesome");

Shell.output(function(data){
    console.log(data);
});

Examples

Running a .ps1 script:

Shell = ps("'Path/To/Your/Script.ps1'");

Don't forget the "' '" around the path

Putting an input to yor script:

Just use [Console]::In.ReadLine() instead of Read-Host in your script:

$t = [Console]::In.ReadLine();
echo $t

and .input property in your node app:

powershell.input("node-powershell Rocks");

License

MIT