2

Can you help me with a javascript to run a powershell script? The both files are on the same local machine.

1
  • 1
    node-powershell is your friend :) Commented Nov 24, 2017 at 20:10

1 Answer 1

1

I assume you are referring to server side javascript(node.js) you can use .exec() function in the child_process module . eg

require('child_process').exec('ls',
    function (err, stdout, stderr) {
        console.log( stdout);   

        if (err) {
             console.log('Error ' + err);
        }
    });

will run the ls command

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.