node-wmi icon indicating copy to clipboard operation
node-wmi copied to clipboard

querying for multiple properties

Open WJScott66 opened this issue 6 years ago • 1 comments

I have not found a way to collect more than one property other than to collect all/any by not providing the criteria. I this possible? Example I am trying to query class: 'Win32_BIOS' and return Properties: 'SMBIOSBIOSVersion', 'SerialNumber'

WJScott66 avatar Jul 16 '19 19:07 WJScott66

you can just add this into the query itself:

module.exports.test = () => new Promise((resolve) => { wmi.query('SELECT SMBIOSBIOSVersion, SerialNumber FROM Win32_BIOS', (err, response) => { if (err) { console.log('i have an error', JSON.stringify(err)); } else { console.log('I have a response',JSON.stringify(response, null, 2)); } }); });

here is my response by calling this:

I have a response [ { "SerialNumber": "5CG9160RBY", "SMBIOSBIOSVersion": "Q78 Ver. 01.06.00" } ]

jhylton avatar Mar 12 '20 13:03 jhylton