mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-16 06:31:04 +00:00
Update powershell.js
This commit is contained in:
parent
dbe48f9624
commit
870ad0e52e
|
@ -5,6 +5,8 @@
|
||||||
var SHELL = require("lib/shell");
|
var SHELL = require("lib/shell");
|
||||||
|
|
||||||
var PowershellObject = function() {
|
var PowershellObject = function() {
|
||||||
|
var _interface = SHELL.create();
|
||||||
|
|
||||||
this.execType = "ps1";
|
this.execType = "ps1";
|
||||||
this.dataType = -1;
|
this.dataType = -1;
|
||||||
this.target = null;
|
this.target = null;
|
||||||
|
@ -75,7 +77,6 @@ var PowershellObject = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var cmd = [
|
var cmd = [
|
||||||
"powershell.exe",
|
|
||||||
"-NoProfile",
|
"-NoProfile",
|
||||||
"-ExecutionPolicy",
|
"-ExecutionPolicy",
|
||||||
"ByPass",
|
"ByPass",
|
||||||
|
@ -117,12 +118,15 @@ var PowershellObject = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.exec = function(args) {
|
this.exec = function(args) {
|
||||||
return SHELL.exec(this.build(args));
|
return _interface.exec(this.build(args));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.runAs = function(args) {
|
this.runAs = function(args) {
|
||||||
return this.exec("Start-Process cmd \"/q /c " + SHELL.addslashes(this.build(args)) + "\" -Verb RunAs");
|
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() {
|
function create() {
|
||||||
|
@ -145,7 +149,7 @@ exports.execScript = execScript;
|
||||||
exports.execCommand = execCommand;
|
exports.execCommand = execCommand;
|
||||||
exports.runAs = runAs;
|
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.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user