Update powershell.js

This commit is contained in:
Namhyeon Go 2020-07-19 05:51:23 +09:00
parent cd0f9face3
commit dedfbbefea

View File

@ -6,8 +6,24 @@ var scope = {
require: global.require
};
scope.execScript = function(scriptName) {
return SHELL.exec("powershell.exe -NoProfile -ExecutionPolicy Bypass -nologo -file " + scriptName + ".ps1");
scope.execScript = function(scriptName, args) {
var arguments = [
"powershell.exe",
"-NoProfile",
"-ExecutionPolicy",
"ByPass",
"-nologo",
"-file",
scriptName + ".ps1"
];
if(typeof(args) !== "undefined") {
for(var i in args) {
arguments.push(args[i]);
}
}
return SHELL.exec(arguments.join(' '));
};
return scope;