mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update powershell.js
This commit is contained in:
parent
cd0f9face3
commit
dedfbbefea
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user