Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript execute powershell script

var spawn = require("child_process").spawn,child;
child = spawn("powershell.exe",["c:	emphelloworld.ps1"]);
child.stdout.on("data",function(data){
    console.log("Powershell Data: " + data);
});
child.stderr.on("data",function(data){
    console.log("Powershell Errors: " + data);
});
child.on("exit",function(){
    console.log("Powershell Script finished");
});
child.stdin.end(); //end input
 
PREVIOUS NEXT
Tagged: #javascript #execute #powershell #script
ADD COMMENT
Topic
Name
9+7 =