diff --git a/CHANGELOG.md b/CHANGELOG.md index 859b91e..28dd98b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.21.20 | 2023-11-24 | `powerShell()` fix invalid pattern (windows) | | 5.21.19 | 2023-12-03 | fix typescript typings | | 5.21.18 | 2023-11-24 | `networkConnections()` fix truncated ip6 addr (macOS) | | 5.21.17 | 2023-11-11 | `system()` Raspberry Pi 5 name fix | diff --git a/docs/history.html b/docs/history.html index 381a219..02a276c 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + 5.21.20 + 2023-12-03 + powerShell() fix invalid pattern (windows) + 5.21.19 2023-12-03 diff --git a/docs/index.html b/docs/index.html index 7087703..001e7fa 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.21.19
+
New Version: 5.21.20
diff --git a/lib/util.js b/lib/util.js index 583d78f..be116dc 100644 --- a/lib/util.js +++ b/lib/util.js @@ -423,10 +423,10 @@ function powerShellRelease() { function powerShell(cmd) { - const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))' - ].join('|'); + /// const pattern = [ + /// '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + /// '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))' + /// ].join('|'); if (_psPersistent) { const id = Math.random().toString(36).substring(2, 12); @@ -472,7 +472,7 @@ function powerShell(cmd) { } if (child && child.pid) { child.stdout.on('data', function (data) { - result = result + data.toString('utf8').replace(pattern, ''); + result = result + data.toString('utf8'); }); child.stderr.on('data', function () { child.kill();