baseboard() improved parsing (windows)

This commit is contained in:
Sebastian Hildebrandt 2023-09-18 06:02:46 +02:00
parent 734b52e28b
commit 1b62892f86
4 changed files with 14 additions and 10 deletions

View File

@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.21.6 | 2023-09-16 | `baseboard()` improved parsing (windows) |
| 5.21.5 | 2023-09-15 | `chassis()`, `baseboard()` improved parsing (windows) |
| 5.21.4 | 2023-09-02 | `wifiConnections()` fixed when no wifi chip (macOS) |
| 5.21.3 | 2023-08-31 | `cpuTemperature()` improved parsing for AMD (linux) |

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.21.6</th>
<td>2023-09-18</td>
<td><span class="code">baseboard()</span> improved parsing (windows)</td>
</tr>
<tr>
<th scope="row">5.21.5</th>
<td>2023-09-15</td>

View File

@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.21.5</span></div>
<div class="version">New Version: <span id="version">5.21.6</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">
@ -212,7 +212,7 @@
<div class="title">Downloads last month</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">645</div>
<div class="numbers">646</div>
<div class="title">Dependents</div>
</div>
</div>

View File

@ -318,10 +318,11 @@ function system(callback) {
exports.system = system;
function cleanDefaults(s) {
if (s === 'Default string') { s = ''; }
if (s.toLowerCase().indexOf('o.e.m.') !== -1) { s = ''; }
return s
const cmpStr = s.toLowerCase();
if (cmpStr.indexOf('o.e.m.') === -1 && cmpStr.indexOf('default string') === -1 && cmpStr !== 'default') {
return s || '';
}
return '';
}
function bios(callback) {
@ -561,7 +562,7 @@ function baseboard(callback) {
const workload = [];
const win10plus = parseInt(os.release()) >= 10;
const maxCapacityAttribute = win10plus ? 'MaxCapacityEx' : 'MaxCapacity';
workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl'));
workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
util.promiseAll(
workload
@ -579,9 +580,6 @@ function baseboard(callback) {
if (!result.assetTag) {
result.assetTag = cleanDefaults(util.getValue(lines, 'sku', ':'));
}
if (!result.assetTag) {
result.assetTag = cleanDefaults(util.getValue(lines, 'SMBIOSAssetTag', ':'));
}
// memphysical
lines = data.results[1] ? data.results[1].toString().split('\r\n') : [''];