W2KSG: WMI method and properties

Discovering the methods and properties available to a WMI class is very straight forward with PowerShell.  Back to Get-Member.  We can use it like this

## Listing 6.14
Get-WmiObject -Class Win32_Service | Get-Member -MemberType property

## Listing 6.15
Get-WmiObject -Class Win32_Service | Get-Member -MemberType method

These two scripts will display the properties and methods of the Win32_Service class respectively.  Any other class can be substituted as required.


Share this post :


Technorati Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>