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: ,
About these ads
This entry was posted in PowerShell and WMI. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s