Accessing WMI Instances in One Line

by Jun 22, 2010

While you can use Get-WMIObject to query for WMI objects and then select the ones you are really after, you can also cast a WMI object path to a WMI object and get to that instance immediately. For example, the following accesses the WMI object representing drive C: and will tell you a ton of interesting details about that drive:

[WMI]'Win32_LogicalDisk="C:"'