Chapter 13. Calling WMI Methods on WMI Classes

After completing this chapter, you will be able to:

  • Use WMI cmdlets to execute instance methods.

  • Use WMI cmdlets to execute static methods.

Using WMI cmdlets to execute instance methods

There are actually several ways to call Microsoft Windows Management Instrumentation (WMI) methods in Windows PowerShell. One reason for this is that some WMI methods are instance methods, which means they only work on an instance of a class. Other methods are static methods, which mean they do not operate on an instance of the class. For example, the Terminate method from the WIN32_Process class is an instance method—it will only operate against a specific instance of the WIN32_Process class. If you do not have a reference ...

Get Windows PowerShell™ 3.0 Step by Step now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.