Chapter 2. CIM sessions

 

Richard Siddaway

PowerShell v3 introduces a great deal of new functionality. The biggest changes are associated with Windows Management Instrumentation (WMI).

Note

WMI is Microsoft’s implementation of the industry standard Common Information Model (CIM). With the Windows 8/2012 wave of products, Microsoft started moving to a more standards-based approach for WMI, and new terminology has emerged based on these changes.

With WMI in PowerShell v3, you get

  • A new API
  • New objects and .NET classes
  • A new set of cmdlets
  • CIM sessions
  • The ability to create cmdlets from WMI classes

One chapter can’t cover all of these topics, so I’m going to concentrate on CIM sessions with a side trip through the CIM cmdlets. For the other topics, see my book PowerShell and WMI (Manning 2012).

I start the chapter with a look at how WMI has been used in the past and some of the problems associated with it, followed by a quick look at the new CIM cmdlets, including comparisons to the existing WMI cmdlets where applicable.

Then I discuss CIM sessions, and I close the chapter by showing you how to configure CIM sessions to work with systems that still use legacy versions of PowerShell.

WMI

The WMI cmdlets in PowerShell v2 are great—if you’ve ever tried working with WMI through VBScript, you’ll appreciate how great they are! But WMI cmdlets do come with a few problems.

CIM cmdlets

Using CIM sessions

CIM session options

Summary

About the author

sitemap