osInfo() faster hyper-v detection (win)
This commit is contained in:
parent
adbbad2780
commit
193658a2ad
@ -203,7 +203,7 @@
|
||||
</div>
|
||||
<div class="row number-section">
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
<div class="numbers">14,535</div>
|
||||
<div class="numbers">14,587</div>
|
||||
<div class="title">Lines of code</div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||
|
||||
@ -324,7 +324,8 @@ function osInfo(callback) {
|
||||
const workload = [];
|
||||
workload.push(util.wmic('os get /value'));
|
||||
// workload.push(execPromise('systeminfo', util.execOptsWin));
|
||||
workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
||||
// workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
|
||||
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
||||
workload.push(util.powerShell('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession'));
|
||||
util.promiseAll(
|
||||
workload
|
||||
@ -336,9 +337,11 @@ function osInfo(callback) {
|
||||
result.servicepack = util.getValue(lines, 'ServicePackMajorVersion', '=').trim() + '.' + util.getValue(lines, 'ServicePackMinorVersion', '=').trim();
|
||||
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);
|
||||
const hyperv = data.results[1] ? data.results[1].toString().split('\r\n') : [];
|
||||
result.hypervisor = (util.getValue(hyperv, 'HyperVisorPresent').toLowerCase() === 'true');
|
||||
// result.hypervisor = (systeminfo.indexOf('hypervisor has been detected') !== -1) || (systeminfo.indexOf('ein Hypervisor erkannt') !== -1) || (systeminfo.indexOf('Un hyperviseur a ') !== -1);
|
||||
// const hyperv = data.results[1] ? data.results[1].toString().split('\r\n') : [];
|
||||
// result.hypervisor = (util.getValue(hyperv, 'HyperVisorPresent').toLowerCase() === 'true');
|
||||
const hyperv = data.results[1] ? data.results[1].toString().toLowerCase() : '';
|
||||
result.hypervisor = hyperv.indexOf('true') !== -1;
|
||||
const term = data.results[2] ? data.results[2].toString() : '';
|
||||
result.remoteSession = (term.toString().toLowerCase().indexOf('true') >= 0);
|
||||
isUefiWindows().then(uefi => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user