versions() improved powerShell parsing (windows)

This commit is contained in:
Sebastian Hildebrandt 2025-01-06 22:22:51 +01:00
parent 976b4df6e5
commit befa5375a1
4 changed files with 8 additions and 2 deletions

View File

@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.25.4 | 2025-01-06 | `versions()` improved powerShell parsing (windows) |
| 5.25.3 | 2025-01-05 | `memLayout()` improved speed parsing (windows) |
| 5.25.2 | 2025-01-05 | `battery()` improved serial and model parsing (macOS) |
| 5.25.1 | 2025-01-05 | `cpuCurrentSpeed()` Deno CPU speed workarround (linux) |

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.25.4</th>
<td>2024-01-06</td>
<td><span class="code">versions()</span> powerShell parsing (windows)</td>
</tr>
<tr>
<th scope="row">5.25.3</th>
<td>2024-01-05</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>
3<div class="version">New Version: <span id="version">5.25.3</span></div>
3<div class="version">New Version: <span id="version">5.25.4</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">

View File

@ -1081,7 +1081,7 @@ function versions(apps, callback) {
if ({}.hasOwnProperty.call(appsObj.versions, 'powershell')) {
if (_windows) {
util.powerShell('$PSVersionTable').then(stdout => {
const lines = stdout.toString().split('\n').map(line => line.replace(/ +/g, ' ').replace(/ +/g, ':'));
const lines = stdout.toString().toLowerCase().split('\n').map(line => line.replace(/ +/g, ' ').replace(/ +/g, ':'));
appsObj.versions.powershell = util.getValue(lines, 'psversion');
functionProcessed();
});