Skip to content

Commit

Permalink
baseboard() improved parsing (windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed Sep 18, 2023
1 parent 734b52e commit 1b62892
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
5 changes: 5 additions & 0 deletions docs/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ <h3>Full version history</h3>
</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>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down
14 changes: 6 additions & 8 deletions lib/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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
Expand All @@ -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') : [''];
Expand Down

0 comments on commit 1b62892

Please sign in to comment.