SOLVED: No easy way to combine multiple WMI properties of multiple WMI instances

To get each instance returned separately, you want to use select objects, rather than select. Using selects just flattens the returned data as a list, which is normally fine when getting the properties of a single object.

(As I don’t have multiple monitors, I used memory device to show the plural return values.)

Q: (String value of Properties "Description" of it,String value of Properties"DeviceID" of it,String value of Properties"StartingAddress" of it)  of select objects "* from win32_MemoryDevice" of wmi

A: Memory Device, Memory Device 0, 0
A: Memory Device, Memory Device 1, 4194304
T: 3.874 ms
I: plural ( string, string, string )

So, you either want just the returned values for your properties:

Q: (String value of Properties "InstanceName" of it,String value of Properties"WeekOfManufacture" of it,String value of Properties"YearOfManufacture" of it) of select objects "InstanceName,WeekOfManufacture,YearOfManufacture from WMIMonitorID" of wmis "root\wmi"

A: DISPLAY\ACI27E3\5&1d2a693b&0&UID1048848_0, 34, 2012
T: 4.701 ms
I: plural ( string, string, string )

Or if you want to keep the field names intact (to possibly extract and use later), just return the Name=Value of each one:

Q: (Properties "InstanceName" of it,Properties "WeekOfManufacture" of it,Properties "YearOfManufacture" of it) of select objects "InstanceName,WeekOfManufacture,YearOfManufacture from WMIMonitorID" of wmis "root\wmi"

A: InstanceName=DISPLAY\ACI27E3\5&1d2a693b&0&UID1048848_0, WeekOfManufacture=34, YearOfManufacture=2012
T: 4.932 ms
I: plural ( wmi select, wmi select, wmi select )

3 Likes