Update powershell.js

This commit is contained in:
Namhyeon Go 2024-07-10 11:56:53 +09:00 committed by GitHub
parent dbe48f9624
commit 870ad0e52e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;