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-powershellQuick 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 $tand .input property in your node app:
powershell.input("node-powershell Rocks");