What I've done here is exactly the same as the first example - until lines 5-12, where I have inserted another FOR loop. Its job is to get the properties of each oItem returned by the WMI query, and return that item's name and value properties. So this form can be handy when you do not already know the name of each property that will be returned by the WMI call.
Also take note of the IF clause at lines 7-8. Some WMI properties will be returned as arrays, which take a bit more planning and coding to display properly. For this example I simplified things by simply ignoring the contents of the array, and printing notification that this was done.
These two examples of WMI query can form the basis of many, if not most, of your WMI information retreival scripts. Often you'll only need to change the WMI classname near the end of line 3 (in both examples).