2

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

M. Plezsen
  • 21
  • 1
  • 3

1 Answers1

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

UchihaItachi
  • 2,602
  • 14
  • 21