Excluding WMI system properties with Powershell

When using Windows Management Instrumentation (WMI)  in your Powershell script you will see a load of system properties returned. These are indicated by a preceding “__” (double underscore) as seen below when issuing get-wmiobject -class “Win32_Processor”:
WMI_System_Properties
 
An obvious attempt to prevent these system properties from being returned would be to use the -ExcludeProperty switch with “__*” specified. As shown though this does not achieve the desired result, the system properties are still returned:
WMI_System_Properties_Exclude
 
Strangely, well it seems strange to me on initially looking at it, you need to specifically return all properties before you can exclude any:
WMI_System_Properties_Property_Exclude
 
Now we can see how to exclude those system properties. You may on some occasion wish to return those properties but for the purposes of bringing back information for reports etc. you may wish to exclude them.
Hope this has helped, what interesting uses have you come up with for the information returned from WMI?


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *