mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-16 08:13:30 +00:00
Modified, so 32-bit PowerShell is used from SysWow64 on 64-bit windows, to work around issue where PowerShell will respawn itself
This commit is contained in:
@@ -134,7 +134,14 @@ function windows_terminal() {
|
|||||||
|
|
||||||
this.PowerShellCapable = function()
|
this.PowerShellCapable = function()
|
||||||
{
|
{
|
||||||
return (require('fs').existsSync(process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'));
|
if (require('os').arch() == 'x64')
|
||||||
|
{
|
||||||
|
return (require('fs').existsSync(process.env['windir'] + '\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (require('fs').existsSync(process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.StartEx = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, terminalTarget)
|
this.StartEx = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, terminalTarget)
|
||||||
@@ -220,7 +227,14 @@ function windows_terminal() {
|
|||||||
}
|
}
|
||||||
this.StartPowerShell = function StartPowerShell(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT)
|
this.StartPowerShell = function StartPowerShell(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT)
|
||||||
{
|
{
|
||||||
return (this.StartEx(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'));
|
if (require('os').arch() == 'x64')
|
||||||
|
{
|
||||||
|
return (this.StartEx(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, process.env['windir'] + '\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (this.StartEx(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT, process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._stop = function () {
|
this._stop = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user