20.4. Language Support for WMI Objects

Before the second release candidate build's release, the only WMI support in PowerShell was provided by the Get-WmiObject cmdlet. Luckily, user feedback made the PowerShell team reconsider that. At the last possible moment, they added several language enhancements that simplify working with WMI objects. The most important enhancements are the ability to cast specially formatted strings into WMI objects. This allows us to use strings as WMI object monikers similar to URLs. The thing to keep in mind is that all casts that have been added are just convenience features. Everything they do can be replicated using Get-WmiObject and some knowledge about how WMI and CIM work.

The first convenience feature we are ...

Get Pro Windows PowerShell 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.