osInfo() added remoteSession (windows)
This commit is contained in:
parent
660377bd0f
commit
469a761af1
@ -324,6 +324,7 @@ function osInfo(callback) {
|
|||||||
const workload = [];
|
const workload = [];
|
||||||
workload.push(util.wmic('os get /value'));
|
workload.push(util.wmic('os get /value'));
|
||||||
workload.push(execPromise('systeminfo', util.execOptsWin));
|
workload.push(execPromise('systeminfo', util.execOptsWin));
|
||||||
|
workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'))
|
||||||
util.promiseAll(
|
util.promiseAll(
|
||||||
workload
|
workload
|
||||||
).then(data => {
|
).then(data => {
|
||||||
@ -335,13 +336,8 @@ function osInfo(callback) {
|
|||||||
result.codepage = util.getCodepage();
|
result.codepage = util.getCodepage();
|
||||||
const systeminfo = data.results[1] ? data.results[1].toString() : '';
|
const systeminfo = data.results[1] ? data.results[1].toString() : '';
|
||||||
result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('Es wurde ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('Es wurde ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
||||||
// isTerminalSession
|
const term = data.results[2] ? data.results[2].toString() : '';
|
||||||
try {
|
result.remoteSession = (term.toString().toLowerCase().indexOf('true') >= 0);
|
||||||
const term = execSync('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession').toString();
|
|
||||||
result.remoteSession = (term.toLowerCase().indexOf('true') >= 0);
|
|
||||||
} catch (e) {
|
|
||||||
util.noop();
|
|
||||||
}
|
|
||||||
isUefiWindows().then(uefi => {
|
isUefiWindows().then(uefi => {
|
||||||
result.uefi = uefi;
|
result.uefi = uefi;
|
||||||
if (callback) {
|
if (callback) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user