From 660377bd0f4e983d7d0eff5355105574ca70cff5 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Fri, 12 Feb 2021 16:07:59 +0100 Subject: [PATCH] osInfo() added remoteSession (windows) --- lib/osinfo.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/osinfo.js b/lib/osinfo.js index eb887f1..9f92c02 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -335,6 +335,13 @@ function osInfo(callback) { result.codepage = util.getCodepage(); 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); + // isTerminalSession + try { + 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 => { result.uefi = uefi; if (callback) {