Jul 312012
 

Find WMI Classes with PowerShell

Get-WmiObject is a great cmdlet that returns all instances of a WMI class:

PS> Get-WmiObject-ClassWin32_LogicalDisk

All you need to know is the name of the appropriate WMI class that represents what you are looking for. Fortunately, Get-WmiObject has a built-in class browser. Simply add the switch parameter -List, and now you can use wildcards:

PS> Get-WmiObject-ClassWin32_*Disk*-List

Next, use the first call again and replace the class name with the class you want to try. Note that not all of the class names provide useful information. If the command does not return anything, then that’s OK: it tells you that there is no instance for the class you specified.

Leave a Reply