systeminformation 5.25.4 → 5.25.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/osinfo.js CHANGED
@@ -1120,7 +1120,26 @@ function shell(callback) {
1120
1120
  return new Promise((resolve) => {
1121
1121
  process.nextTick(() => {
1122
1122
  if (_windows) {
1123
- resolve('cmd');
1123
+ try {
1124
+ const result = 'CMD';
1125
+ util.powerShell(`Get-CimInstance -className win32_process | where-object {$_.ProcessId -eq ${process.ppid} } | select Name`).then(stdout => {
1126
+ let result = 'CMD';
1127
+ if (stdout) {
1128
+ if (stdout.toString().toLowerCase().indexOf('powershell') >= 0) {
1129
+ result = 'PowerShell';
1130
+ }
1131
+ }
1132
+ if (callback) {
1133
+ callback(result);
1134
+ }
1135
+ resolve(result);
1136
+ });
1137
+ } catch {
1138
+ if (callback) {
1139
+ callback(result);
1140
+ }
1141
+ resolve(result);
1142
+ }
1124
1143
  } else {
1125
1144
  let result = '';
1126
1145
  exec('echo $SHELL', function (error, stdout) {
package/lib/system.js CHANGED
@@ -189,7 +189,7 @@ function system(callback) {
189
189
  const model = util.getValue(lines, 'model:', ':', true);
190
190
  // reference values: https://elinux.org/RPi_HardwareHistory
191
191
  // https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
192
- if ((result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2710' || result.model === 'BCM2711' || result.model === 'BCM2836' || result.model === 'BCM2837') && model.toLowerCase().indexOf('raspberry') >= 0) {
192
+ if ((result.model === 'BCM2835' || result.model === 'BCM2708' || result.model === 'BCM2709' || result.model === 'BCM2710' || result.model === 'BCM2711' || result.model === 'BCM2836' || result.model === 'BCM2837' || result.model === '') && model.toLowerCase().indexOf('raspberry') >= 0) {
193
193
  const rPIRevision = util.decodePiCpuinfo(lines);
194
194
  result.model = rPIRevision.model;
195
195
  result.version = rPIRevision.revisionCode;
package/lib/util.js CHANGED
@@ -661,7 +661,8 @@ function isRaspberry() {
661
661
  }
662
662
 
663
663
  const hardware = getValue(cpuinfo, 'hardware');
664
- return (hardware && PI_MODEL_NO.indexOf(hardware) > -1);
664
+ const model = getValue(cpuinfo, 'model');
665
+ return ((hardware && PI_MODEL_NO.indexOf(hardware) > -1) || (model && model.indexOf('Raspberry Pi') > -1));
665
666
  }
666
667
 
667
668
  function isRaspbian() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.25.4",
3
+ "version": "5.25.6",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",