There is no easy way to iterate over a set of WMI instances and use multiple properties together per instance. Ideally the results from the query would be grouped so that they could be accessed in a per-instance basis more easily.
WMI results are given as a plural set of strings across all instances, which makes it hard to match up multiple properties with the instance they belong to.
Here are some examples: ( in this case I have 2 monitors that happened to have been made at the same time, but that is a coincidence )
q:selects "InstanceName,WeekOfManufacture,YearOfManufacture from WMIMonitorID" of wmis "root\wmi"
A: InstanceName=DISPLAY\MONITOR1
A: WeekOfManufacture=45
A: YearOfManufacture=2012
A: InstanceName=DISPLAY\MONITOR2
A: WeekOfManufacture=45
A: YearOfManufacture=2012
T: 6.461 ms
I: plural wmi select
I have to combine it all into a single string, break it apart using the first item returned, normalize the strings, and then parse them:
q:((date "01 Jan 0000") + (item 0 of it as integer)*year + (item 1 of it as integer)*week, it) of (following text of last ";YearOfManufacture=" of preceding text of last ";" of it, preceding text of first ";" of following text of last ";WeekOfManufacture=" of it,it) of (if (it ends with ";") then it else it & ";") of (it as trimmed string) whose(it != "") of substrings separated by "InstanceName=" of concatenations ";" of (it as string) whose(it contains "=") of selects "InstanceName,WeekOfManufacture,YearOfManufacture from WMIMonitorID" of wmis "root\wmi"
A: ( Sun, 11 Nov 2012 ), ( 2012, 45, DISPLAY\MONITOR1;WeekOfManufacture=45;YearOfManufacture=2012; )
A: ( Sun, 11 Nov 2012 ), ( 2012, 45, DISPLAY\MONITOR2;WeekOfManufacture=45;YearOfManufacture=2012; )
T: 5.946 ms
I: plural ( date, ( substring, substring, string ) )
References:
https://support.bigfix.com/inspectors/Primitive%20Objects_Any.html#date