Skip to content

Commit 1b62892

Browse files
baseboard() improved parsing (windows)
1 parent 734b52e commit 1b62892

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
8383

8484
| Version | Date | Comment |
8585
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
86+
| 5.21.6 | 2023-09-16 | `baseboard()` improved parsing (windows) |
8687
| 5.21.5 | 2023-09-15 | `chassis()`, `baseboard()` improved parsing (windows) |
8788
| 5.21.4 | 2023-09-02 | `wifiConnections()` fixed when no wifi chip (macOS) |
8889
| 5.21.3 | 2023-08-31 | `cpuTemperature()` improved parsing for AMD (linux) |

docs/history.html

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ <h3>Full version history</h3>
5757
</tr>
5858
</thead>
5959
<tbody>
60+
<tr>
61+
<th scope="row">5.21.6</th>
62+
<td>2023-09-18</td>
63+
<td><span class="code">baseboard()</span> improved parsing (windows)</td>
64+
</tr>
6065
<tr>
6166
<th scope="row">5.21.5</th>
6267
<td>2023-09-15</td>

docs/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
<img class="logo" src="assets/logo.png" alt="logo">
171171
<div class="title">systeminformation</div>
172172
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
173-
<div class="version">New Version: <span id="version">5.21.5</span></div>
173+
<div class="version">New Version: <span id="version">5.21.6</span></div>
174174
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
175175
</div>
176176
<div class="down">
@@ -212,7 +212,7 @@
212212
<div class="title">Downloads last month</div>
213213
</div>
214214
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
215-
<div class="numbers">645</div>
215+
<div class="numbers">646</div>
216216
<div class="title">Dependents</div>
217217
</div>
218218
</div>

lib/system.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,11 @@ function system(callback) {
318318
exports.system = system;
319319

320320
function cleanDefaults(s) {
321-
if (s === 'Default string') { s = ''; }
322-
if (s.toLowerCase().indexOf('o.e.m.') !== -1) { s = ''; }
323-
324-
return s
321+
const cmpStr = s.toLowerCase();
322+
if (cmpStr.indexOf('o.e.m.') === -1 && cmpStr.indexOf('default string') === -1 && cmpStr !== 'default') {
323+
return s || '';
324+
}
325+
return '';
325326
}
326327
function bios(callback) {
327328

@@ -561,7 +562,7 @@ function baseboard(callback) {
561562
const workload = [];
562563
const win10plus = parseInt(os.release()) >= 10;
563564
const maxCapacityAttribute = win10plus ? 'MaxCapacityEx' : 'MaxCapacity';
564-
workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl'));
565+
workload.push(util.powerShell('Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
565566
workload.push(util.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${maxCapacityAttribute}, MemoryDevices | fl`));
566567
util.promiseAll(
567568
workload
@@ -579,9 +580,6 @@ function baseboard(callback) {
579580
if (!result.assetTag) {
580581
result.assetTag = cleanDefaults(util.getValue(lines, 'sku', ':'));
581582
}
582-
if (!result.assetTag) {
583-
result.assetTag = cleanDefaults(util.getValue(lines, 'SMBIOSAssetTag', ':'));
584-
}
585583

586584
// memphysical
587585
lines = data.results[1] ? data.results[1].toString().split('\r\n') : [''];

0 commit comments

Comments
 (0)