Getting WMI IntelliSense

by Nov 26, 2013

Get-WmiObject provides no IntelliSense for WMI classes, so you either need to know the WMI class name off hand, or use the parameter -List to search for it.

But there's a clever trick: Get-CimInstance does almost the same thing, and its parameter -ClassName also accepts a WMI class name. And this parameter does provide IntelliSense support.

Try this in PowerShell 3.0 ISE:

Now press CTRL+SPACE to invoke IntelliSense. Have a look at the status bar, though. There are hundreds of WMI class names, and on first try, IntelliSense may run in a timeout issue before it could gather all classes. Over time, or when you limit the class name a bit, it will work though.

So simply use Get-CimInstance instead of Get-WmiObject, then select the class name with full IntelliSense support, now rename cmdlet and parameter back to Get-WmiObject -Class.

Or, stick with Get-CimInstance in the first place. It returns basically the same wealth of information. By default, however, it uses WSMan protocol for remoting rather than DCOM.

Twitter This Tip! ReTweet this Tip!