O'Reilly logo

Windows PowerShell™ 3.0 Step by Step by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 to a process, you cannot terminate the process—which makes sense. On the other hand, if you want to create a new instance of a WIN32_Process class, you do not grab a reference ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required