PowerShell for Windows Admins

Jun 6 2011   1:57PM GMT

Get-WmiObject property parameter

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

This is a fairly obvious piece of PowerShell

Get-WmiObject Win32_Volume

We would probably restrict the properties we displayed like this

Get-WmiObject Win32_Volume | select DriveLetter, DriveType, Freespace

or possibly

Get-WmiObject Win32_Volume |
format-table DriveLetter, DriveType, Freespace –AutoSize

If we are dealing with a large number of remote machines we may want to restrict the properties we return – this is where we use the –property parameter

Get-WmiObject Win32_Volume -property @("DriveLetter", "DriveType", "Freespace")


so to get a good display we would want to still use format-table (or select)

Get-WmiObject Win32_Volume -property @("DriveLetter", "DriveType", "Freespace") |
format-table DriveLetter, DriveType, Freespace –AutoSize

The –property parameter gives us another opportunity to restrict the data returned to reduce network traffic but we still need to format the returned data

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: