📌  相关文章
📜  javascript 执行 powershell 脚本 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:53.283000             🧑  作者: Mango

代码示例1
var spawn = require("child_process").spawn,child;
child = spawn("powershell.exe",["c:\\temp\\helloworld.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