Socket
Book a DemoInstallSign in
Socket

node-powershell

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-powershell

Lightweight module to run PowerShell straight from your Node app

Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
19K
-42.43%
Maintainers
1
Weekly downloads
 
Created
Source

Node-PowerShell

Lightweight module to run PowerShell straight from your Node app

Version npmNPM DownloadsDependencies

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

Keywords

node-powershell

FAQs

Package last updated on 13 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts