Invoking WMI class methods

WMI methods enable you to execute different activities on a system. PowerShell provides the ability to hook onto these methods to perform different actions using the invoke-cimmethod cmdlet. In order to determine what methods are available for use in a WMI class, you can leverage the get-cimclass cmdlet, with the optional –class parameter pointing to a WMI class. You then can pipe those results to the selection criteria of | select -ExpandProperty CimClassMethods. This will display all the methods and properties for those methods in that WMI class. This will help you expose what methods are available for a particular class.

To leverage the get-cimclass cmdlet to see the methods in the win32_process class, you can do the ...

Get Mastering Windows PowerShell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.