Accessing WMI Instances in One Line

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:"'

Posted Jun 22 2010, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.