PowerShell: Automating Administrative Tasks
by Michael Shepard, Chendrayan Venkatesan, Sherif Talaat, Brenton J.W. Blawat
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access