Can you help me with a javascript to run a powershell script? The both files are on the same local machine.
Asked
Active
Viewed 5,160 times
1 Answers
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