@ctsy/powershell
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

powershell

use powershell in nodejs

example

import PowerShell from './index';
(async () => {
    let p = new PowerShell()
    try {
        console.log(await p.cmd(`echo 1`))
        console.log(await p.cmd(`echo 2`))
        console.log(await p.cmd(`echo $True`))
        console.log(await p.cmd(`echo $False`))
    } catch (error) {

    }
    p.process.kill()
    process.exit();
})()
function timeout(n: number) {
    return new Promise((s) => setTimeout(s, n))
}

the result

1                   test.ts:5
2                   test.ts:6
True                test.ts:7
False               test.ts:8

Readme

Keywords

Package Sidebar

Install

npm i @ctsy/powershell

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

5.12 kB

Total Files

6

Last publish

Collaborators

  • ida_xyt
  • yanpengquan