mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update powershell.js
This commit is contained in:
parent
dbe48f9624
commit
870ad0e52e
|
@ -5,6 +5,8 @@
|
|||
var SHELL = require("lib/shell");
|
||||
|
||||
var PowershellObject = function() {
|
||||
var _interface = SHELL.create();
|
||||
|
||||
this.execType = "ps1";
|
||||
this.dataType = -1;
|
||||
this.target = null;
|
||||
|
@ -75,7 +77,6 @@ var PowershellObject = function() {
|
|||
}
|
||||
|
||||
var cmd = [
|
||||
"powershell.exe",
|
||||
"-NoProfile",
|
||||
"-ExecutionPolicy",
|
||||
"ByPass",
|
||||
|
@ -117,12 +118,15 @@ var PowershellObject = function() {
|
|||
};
|
||||
|
||||
this.exec = function(args) {
|
||||
return SHELL.exec(this.build(args));
|
||||
return _interface.exec(this.build(args));
|
||||
};
|
||||
|
||||
this.runAs = function(args) {
|
||||
return this.exec("Start-Process cmd \"/q /c " + SHELL.addslashes(this.build(args)) + "\" -Verb RunAs");
|
||||
};
|
||||
|
||||
// set the location of PowerShell runtime
|
||||
_interface.setPrefix("powershell.exe");
|
||||
}
|
||||
|
||||
function create() {
|
||||
|
@ -145,7 +149,7 @@ exports.execScript = execScript;
|
|||
exports.execCommand = execCommand;
|
||||
exports.runAs = runAs;
|
||||
|
||||
exports.VERSIONINFO = "Powershell Interface (powershell.js) version 0.1.3";
|
||||
exports.VERSIONINFO = "Powershell Interface (powershell.js) version 0.1.4";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
Loading…
Reference in New Issue
Block a user