mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-04 09:33:30 +00:00
Added Start(), StartPowerShell(), and PowerShellCapable, to match old API
This commit is contained in:
@@ -120,6 +120,32 @@ function vt()
|
||||
}
|
||||
throw ('Internal Error');
|
||||
}
|
||||
this.PowerShellCapable = function ()
|
||||
{
|
||||
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.Start = function Start(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT)
|
||||
{
|
||||
return (this.Create(process.env['windir'] + '\\System32\\cmd.exe', CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT));
|
||||
}
|
||||
this.StartPowerShell = function StartPowerShell(CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT)
|
||||
{
|
||||
if (require('os').arch() == 'x64')
|
||||
{
|
||||
return (this.Create(process.env['windir'] + '\\SysWow64\\WindowsPowerShell\\v1.0\\powershell.exe', CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT));
|
||||
}
|
||||
else
|
||||
{
|
||||
return (this.Create(process.env['windir'] + '\\System32\\WindowsPowerShell\\v1.0\\powershell.exe', CONSOLE_SCREEN_WIDTH, CONSOLE_SCREEN_HEIGHT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (process.platform == 'win32')
|
||||
|
||||
Reference in New Issue
Block a user