diff --git a/lib/powershell.js b/lib/powershell.js index ff17c74..255b0e7 100644 --- a/lib/powershell.js +++ b/lib/powershell.js @@ -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;