systeminformation 5.11.1 → 5.11.2

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/audio.js CHANGED
@@ -194,7 +194,7 @@ function audio(callback) {
194
194
  });
195
195
  }
196
196
  if (_windows) {
197
- util.powerShell('Get-WmiObject Win32_SoundDevice | fl *').then((stdout, error) => {
197
+ util.powerShell('Get-WmiObject Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl').then((stdout, error) => {
198
198
  if (!error) {
199
199
  const parts = stdout.toString().split(/\n\s*\n/);
200
200
  for (let i = 0; i < parts.length; i++) {
package/lib/battery.js CHANGED
@@ -225,7 +225,7 @@ module.exports = function (callback) {
225
225
  if (_windows) {
226
226
  try {
227
227
  const workload = [];
228
- workload.push(util.powerShell('Get-WmiObject Win32_Battery | fl *'));
228
+ workload.push(util.powerShell('Get-WmiObject Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl'));
229
229
  workload.push(util.powerShell('(Get-WmiObject -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity'));
230
230
  workload.push(util.powerShell('(Get-WmiObject -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity'));
231
231
  util.promiseAll(
package/lib/bluetooth.js CHANGED
@@ -158,7 +158,7 @@ function bluetoothDevices(callback) {
158
158
  });
159
159
  }
160
160
  if (_windows) {
161
- util.powerShell('Get-WmiObject Win32_PNPEntity | fl *').then((stdout, error) => {
161
+ util.powerShell('Get-WmiObject Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl').then((stdout, error) => {
162
162
  if (!error) {
163
163
  const parts = stdout.toString().split(/\n\s*\n/);
164
164
  for (let i = 0; i < parts.length; i++) {
package/lib/cpu.js CHANGED
@@ -797,8 +797,8 @@ function getCpu() {
797
797
  if (_windows) {
798
798
  try {
799
799
  const workload = [];
800
- workload.push(util.powerShell('Get-WmiObject Win32_processor | fl *'));
801
- workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl *'));
800
+ workload.push(util.powerShell('Get-WmiObject Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl'));
801
+ workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl'));
802
802
  // workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
803
803
  workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
804
804
 
@@ -1425,7 +1425,7 @@ function cpuCache(callback) {
1425
1425
  }
1426
1426
  if (_windows) {
1427
1427
  try {
1428
- util.powerShell('Get-WmiObject Win32_processor | fl *').then((stdout, error) => {
1428
+ util.powerShell('Get-WmiObject Win32_processor | select L2CacheSize, L3CacheSize | fl').then((stdout, error) => {
1429
1429
  if (!error) {
1430
1430
  let lines = stdout.split('\r\n');
1431
1431
  result.l1d = 0;
@@ -1435,7 +1435,7 @@ function cpuCache(callback) {
1435
1435
  if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }
1436
1436
  if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }
1437
1437
  }
1438
- util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl ').then((stdout, error) => {
1438
+ util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl').then((stdout, error) => {
1439
1439
  if (!error) {
1440
1440
  const parts = stdout.split(/\n\s*\n/);
1441
1441
  parts.forEach(function (part) {
package/lib/filesystem.js CHANGED
@@ -127,7 +127,7 @@ function fsSize(callback) {
127
127
  if (_windows) {
128
128
  try {
129
129
  // util.wmic('logicaldisk get Caption,FileSystem,FreeSpace,Size').then((stdout) => {
130
- util.powerShell('Get-WmiObject Win32_logicaldisk | fl *').then((stdout, error) => {
130
+ util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,FileSystem,FreeSpace,Size | fl').then((stdout, error) => {
131
131
  if (!error) {
132
132
  let devices = stdout.toString().split(/\n\s*\n/);
133
133
  devices.forEach(function (device) {
@@ -400,7 +400,8 @@ function blockDevices(callback) {
400
400
  let drivetypes = ['Unknown', 'NoRoot', 'Removable', 'Local', 'Network', 'CD/DVD', 'RAM'];
401
401
  try {
402
402
  // util.wmic('logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value').then((stdout, error) => {
403
- util.powerShell('Get-CimInstance -ClassName Win32_LogicalDisk | Format-List *').then((stdout, error) => {
403
+ // util.powerShell('Get-WmiObject Win32_logicaldisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {
404
+ util.powerShell('Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {
404
405
  if (!error) {
405
406
  let devices = stdout.toString().split(/\n\s*\n/);
406
407
  devices.forEach(function (device) {
@@ -1167,8 +1168,8 @@ function diskLayout(callback) {
1167
1168
  if (_windows) {
1168
1169
  try {
1169
1170
  const workload = [];
1170
- workload.push(util.powerShell('Get-WmiObject Win32_DiskDrive | fl *'));
1171
- workload.push(util.powerShell('Get-PhysicalDisk | Format-List'));
1171
+ workload.push(util.powerShell('Get-WmiObject Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl'));
1172
+ workload.push(util.powerShell('Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl'));
1172
1173
  if (util.smartMonToolsInstalled()) {
1173
1174
  try {
1174
1175
  const smartDev = JSON.parse(execSync('smartctl --scan -j'));
package/lib/memory.js CHANGED
@@ -504,7 +504,7 @@ function memLayout(callback) {
504
504
  const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
505
505
 
506
506
  try {
507
- util.powerShell('Get-WmiObject Win32_PhysicalMemory | fl *').then((stdout, error) => {
507
+ util.powerShell('Get-WmiObject Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl').then((stdout, error) => {
508
508
  if (!error) {
509
509
  let devices = stdout.toString().split(/\n\s*\n/);
510
510
  devices.shift();
package/lib/network.js CHANGED
@@ -1306,7 +1306,7 @@ function networkStatsSingle(iface) {
1306
1306
  let ifaceName = ifaceSanitized;
1307
1307
 
1308
1308
  // Performance Data
1309
- util.powerShell('Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface | fl *').then((stdout, error) => {
1309
+ util.powerShell('Get-WmiObject Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl').then((stdout, error) => {
1310
1310
  if (!error) {
1311
1311
  const psections = stdout.toString().split(/\n\s*\n/);
1312
1312
  perfData = parseLinesWindowsPerfData(psections);
package/lib/osinfo.js CHANGED
@@ -330,7 +330,7 @@ function osInfo(callback) {
330
330
  result.release = result.kernel;
331
331
  try {
332
332
  const workload = [];
333
- workload.push(util.powerShell('Get-WmiObject Win32_OperatingSystem | fl *'));
333
+ workload.push(util.powerShell('Get-WmiObject Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl'));
334
334
  // workload.push(execPromise('systeminfo', util.execOptsWin));
335
335
  // workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
336
336
  workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
@@ -745,7 +745,7 @@ function versions(apps, callback) {
745
745
  });
746
746
  } else {
747
747
  if (_windows) {
748
- util.powerShell('Get-WmiObject Win32_Service | fl *').then((stdout) => {
748
+ util.powerShell('Get-WmiObject Win32_Service | select caption | fl').then((stdout) => {
749
749
  let serviceSections = stdout.split(/\n\s*\n/);
750
750
  for (let i = 0; i < serviceSections.length; i++) {
751
751
  if (serviceSections[i].trim() !== '') {
@@ -1140,7 +1140,7 @@ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;
1140
1140
  if (process.arch === 'ia32' && Object.prototype.hasOwnProperty.call(process.env, 'PROCESSOR_ARCHITEW6432')) {
1141
1141
  sysdir = '%windir%\\sysnative\\cmd.exe /c %windir%\\System32';
1142
1142
  }
1143
- util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | fl *').then((stdout) => {
1143
+ util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select UUID | fl').then((stdout) => {
1144
1144
  // let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\s\s+/);
1145
1145
  let lines = stdout.split('\r\n');
1146
1146
  result.hardware = util.getValue(lines, 'uuid', ':').toLowerCase();
package/lib/printer.js CHANGED
@@ -186,7 +186,7 @@ function printer(callback) {
186
186
  });
187
187
  }
188
188
  if (_windows) {
189
- util.powerShell('Get-WmiObject Win32_Printer | fl *').then((stdout, error) => {
189
+ util.powerShell('Get-WmiObject Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl').then((stdout, error) => {
190
190
  if (!error) {
191
191
  const parts = stdout.toString().split(/\n\s*\n/);
192
192
  for (let i = 0; i < parts.length; i++) {
package/lib/processes.js CHANGED
@@ -332,7 +332,7 @@ function services(srv, callback) {
332
332
  }
333
333
  wincommand = `${wincommand.slice(0, -4)}"`;
334
334
  }
335
- wincommand += ' | fl *';
335
+ wincommand += ' | select Name,Caption,Started,StartMode,ProcessId | fl';
336
336
  util.powerShell(wincommand).then((stdout, error) => {
337
337
  if (!error) {
338
338
  let serviceSections = stdout.split(/\n\s*\n/);
@@ -797,7 +797,7 @@ function processes(callback) {
797
797
  });
798
798
  } else if (_windows) {
799
799
  try {
800
- util.powerShell('Get-WmiObject Win32_Process | fl *').then((stdout, error) => {
800
+ util.powerShell('Get-WmiObject Win32_Process | select ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage,CreationDate | fl').then((stdout, error) => {
801
801
  if (!error) {
802
802
  let processSections = stdout.split(/\n\s*\n/);
803
803
  let procs = [];
@@ -969,7 +969,7 @@ function processLoad(proc, callback) {
969
969
  if (procSanitized && processes.length && processes[0] !== '------') {
970
970
  if (_windows) {
971
971
  try {
972
- util.powerShell('Get-WmiObject Win32_Process | fl *').then((stdout, error) => {
972
+ util.powerShell('Get-WmiObject Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl').then((stdout, error) => {
973
973
  if (!error) {
974
974
  let processSections = stdout.split(/\n\s*\n/);
975
975
  let procStats = [];
package/lib/system.js CHANGED
@@ -343,7 +343,7 @@ function system(callback) {
343
343
  }
344
344
  if (_windows) {
345
345
  try {
346
- util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | fl *').then((stdout, error) => {
346
+ util.powerShell('Get-WmiObject Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl').then((stdout, error) => {
347
347
  if (!error) {
348
348
  // let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0)[0].trim().split(/\s\s+/);
349
349
  let lines = stdout.split('\r\n');
@@ -369,7 +369,7 @@ function system(callback) {
369
369
  if (manufacturer.startsWith('xen')) { result.virtualHost = 'Xen'; }
370
370
  if (manufacturer.startsWith('qemu')) { result.virtualHost = 'KVM'; }
371
371
  }
372
- util.powerShell('Get-WmiObject MS_Systeminformation -Namespace "root/wmi" | fl *').then((stdout, error) => {
372
+ util.powerShell('Get-WmiObject MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((stdout, error) => {
373
373
  if (!error) {
374
374
  let lines = stdout.split('\r\n');
375
375
  result.sku = util.getValue(lines, 'systemsku', ':');
@@ -506,7 +506,7 @@ function bios(callback) {
506
506
  }
507
507
  if (_windows) {
508
508
  try {
509
- util.powerShell('Get-WmiObject Win32_bios | fl *').then((stdout, error) => {
509
+ util.powerShell('Get-WmiObject Win32_bios | select Description,Version,Manufacturer,ReleaseDate,BuildNumber,SerialNumber | fl').then((stdout, error) => {
510
510
  if (!error) {
511
511
  let lines = stdout.toString().split('\r\n');
512
512
  const description = util.getValue(lines, 'description', ':');
@@ -662,7 +662,7 @@ function baseboard(callback) {
662
662
  if (_windows) {
663
663
  try {
664
664
  const workload = [];
665
- workload.push(util.powerShell('Get-WmiObject Win32_baseboard | fl *'));
665
+ workload.push(util.powerShell('Get-WmiObject Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl'));
666
666
  workload.push(util.powerShell('Get-WmiObject Win32_physicalmemoryarray | select MaxCapacity, MemoryDevices | fl'));
667
667
  util.promiseAll(
668
668
  workload
@@ -795,7 +795,7 @@ function chassis(callback) {
795
795
  }
796
796
  if (_windows) {
797
797
  try {
798
- util.powerShell('Get-WmiObject Win32_SystemEnclosure | fl *').then((stdout, error) => {
798
+ util.powerShell('Get-WmiObject Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU | fl').then((stdout, error) => {
799
799
  if (!error) {
800
800
  let lines = stdout.toString().split('\r\n');
801
801
 
package/lib/usb.js CHANGED
@@ -263,7 +263,7 @@ function usb(callback) {
263
263
  });
264
264
  }
265
265
  if (_windows) {
266
- util.powerShell('Get-WmiObject CIM_LogicalDevice | where { $_.Description -match "USB"}').then((stdout, error) => {
266
+ util.powerShell('Get-WmiObject CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((stdout, error) => {
267
267
  if (!error) {
268
268
  const parts = stdout.toString().split(/\n\s*\n/);
269
269
  for (let i = 0; i < parts.length; i++) {
package/lib/users.js CHANGED
@@ -253,8 +253,8 @@ function users(callback) {
253
253
  // Promise.all(
254
254
  // workload
255
255
  // ).then(data => {
256
- let cmd = 'Get-WmiObject Win32_LogonSession | fl *' + '; echo \'#-#-#-#\';';
257
- cmd += 'Get-WmiObject Win32_LoggedOnUser | fl *' + '; echo \'#-#-#-#\';';
256
+ let cmd = 'Get-WmiObject Win32_LogonSession | select LogonId,StartTime | fl' + '; echo \'#-#-#-#\';';
257
+ cmd += 'Get-WmiObject Win32_LoggedOnUser | select antecedent,dependent | fl ' + '; echo \'#-#-#-#\';';
258
258
  cmd += 'Get-WmiObject Win32_Process -Filter "name=\'explorer.exe\'" | Select @{Name="sessionid";Expression={$_.SessionId}}, @{Name="domain";Expression={$_.GetOwner().Domain}}, @{Name="username";Expression={$_.GetOwner().User}} | fl' + '; echo \'#-#-#-#\';';
259
259
  cmd += 'query user';
260
260
  util.powerShell(cmd).then(data => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.11.1",
3
+ "version": "5.11.2",
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)",