Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-powershell-updates

rannn50526MIT4.0.1

Easily run PowerShell from your NodeJS app

node-powershell, ps, powershell, node-ps, microsoft, shell, cmd, commandline, command, Line, windows, windows powershell, script, spwan, shells, terminal, linux powershell, powershell github, PowerShell for every system, PowerShell cross-platform, powershell linux, powershell centos, powershell rhel, powershell ubuntu, powershell macos, powershell docker, PowerShell Core, PowerShell Core 6.0, PowerShell 6.0, pwsh

readme

Node-PowerShell

Build Status NPM Version NPM Downloads Coveralls Package Quality Closed Issues Dependencies License GitHub Stars

Node-PowerShell taking advantage of two of the simplest, effective and easy tools that exist in the today technology world. On the one hand, NodeJS which made a revolution in the world of javascript, and on the other hand, PowerShell which recently came out with an initial open-source, cross-platform version, and by connecting them together, gives you the power to create any solution you were asked to, no matter if you are a programmer, an IT or a DevOps guy.

Installation

$ npm i -S node-powershell
$ yarn add node-powershell

Quick start

const Shell = require('node-powershell');

const ps = new Shell({
  executionPolicy: 'Bypass',
  noProfile: true
});

ps.addCommand('echo node-powershell');
ps.invoke()
.then(output => {
  console.log(output);
})
.catch(err => {
  console.log(err);
});

Documentation

Documentation

PowerShell 6

Microsoft
GitHub

TODO

  • <input checked="" disabled="" type="checkbox"> Full pwsh support.
  • <input checked="" disabled="" type="checkbox"> New docs & homepage.
  • <input checked="" disabled="" type="checkbox"> PSCommand class.
  • <input checked="" disabled="" type="checkbox"> CI improvements.
  • <input disabled="" type="checkbox"> Postinstall script.
  • <input disabled="" type="checkbox"> Improve error handling.
  • <input disabled="" type="checkbox"> More examples.
  • <input disabled="" type="checkbox"> More test + coverage.
  • <input disabled="" type="checkbox"> Electron + Lambada POC.

License

MIT © Ran Cohen

changelog

Change Log

v4.0.0 - 2019-02-12

Implemented enhancements:

  • Add full support to pwsh & pwsh-preview. finally :)
  • New Shell methods.
  • New PSCommand class.
  • New typed errors.
  • New icon & homepage & docs.
  • Add NPS environment variable support.
  • Improve ci process (run nps on all OS & PS combinations).
  • Performance improvement.

Breaking changes:

  • @param syntax -> es6 string templates.

Deprecate features:

  • debugMsg option -> verbose option.
  • addCommand params option -> addParameter/s.

Fixed bugs:

  • Issue with ps dispose. #37
  • node-powershell was unable to start powershell. #39
  • Add proper support for multi-line PowerShell strings. #44
  • your documentation page has nothing in it. #47
  • String parameters with quotes hang shell. #54
  • Powershell Core Feedback. #72
  • API Document is not working. #64

v3.3.0 - 2017-10-28

Implemented enhancements:

  • Add support to PowerShell Hashtable data type - {name: JSON} -> [hashtable]$hashtable.
  • New way to detect output - Unique ShellStream class created.
  • Add optional parameter to determine the PS version.
  • Add optional parameter to change EOI string.
  • Improve performance.

Fixed bugs:

  • Added shell option to change EOI string. #18
  • Fix EOL Bug. #34
  • Intermittently the data from the power shell instance is blank. #20
  • Escaping string input. #21
  • addCommand("ls c:") followed by invoke() always emits nothing (blank string). #25
  • "EOI" marker matching logic often "eats" last chunk of output. #26
  • NO output from powershell when an argument value changes. #31
  • new-webserviceproxy isn't supported. #32
  • 'end' event not fired, outputs merged. #33

v3.1.0 - 2017-02-25

Implemented enhancements:

  • Add support to most of PowerShell data types including switch options ({name: ''}).
  • New syntax to send parameters to addCommand method. {name: value}
  • New homepage and docs.
  • Add headers to build files.
  • Integration with travis-ci.

Fixed bugs:

  • Unable to send [switch] options. #17
  • Unable to send array of strings. #15