PowerShell for Windows Admins

Dec 21 2009   11:41AM GMT

Class Descriptions

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

We have seen how to find the classes associated with a particular aspect of our system e.g.

Get-WmiObject  -List  *disk*

We will see this one again soon when we turn our attention to disks

One thing we can’t get directly is a description of the class so we can confirm it does what we think.  Well, with a little bit of digging in Powershell 2 we can use the –ammended parameter to display a description

PS> ((Get-WmiObject -List Win32_OperatingSystem -Amended).Qualifiers | Where {$_.Name -eq "Description"}).Value

The Win32_OperatingSystem class represents an operating system installed on a Win32 computer system. Any operating system that can be installed on a Win32 system is a descendent (or member) of this class.
Example: Microsoft Windows 95.

We list the class we are interested in and select the qualifiers. A where statement is used to filter for the description qualifier and then we display its value.

We don’t normally display the description because it is a more expensive operation.

Technorati Tags: ,,

 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: