Using WMI objects

When you leverage PowerShell to interact with WMI, you are interacting with WMI namespaces and WMI classes. WMI namespaces are collections of classes that represent management of a particular system. The Windows operating system, for example, uses the default root\cimv2 namespace, and that collection contains over a thousand classes. Classes have multiple attributes such as properties and methods. Class properties represent information about that particular class, which is typically represented by a string or a numeric format. Methods are more like actions, which allow you to interact with that object, or other objects on a system.

The two primary cmdlets that allow you to retrieve a WMI object on a system are get-wmiobject and ...

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.