mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 06:01:04 +00:00
Update powershell.js
This commit is contained in:
parent
cd0f9face3
commit
dedfbbefea
|
@ -6,8 +6,24 @@ var scope = {
|
||||||
require: global.require
|
require: global.require
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.execScript = function(scriptName) {
|
scope.execScript = function(scriptName, args) {
|
||||||
return SHELL.exec("powershell.exe -NoProfile -ExecutionPolicy Bypass -nologo -file " + scriptName + ".ps1");
|
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;
|
return scope;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user