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

Working with associations

In the old-fashioned VBScript days, working with association classes was extremely complicated. This is unfortunate, because WMI association classes are extremely powerful and useful. Earlier versions of Windows PowerShell simplified working with association classes, primarily because it simplified working with WMI data in general. However, figuring out how to utilize the Windows PowerShell advantage was still pretty much an advanced technique. Luckily, Windows PowerShell 3.0 has the CIM classes that introduce the Get-CimAssociatedInstance cmdlet.

The first thing to do when attempting to find a WMI association class is retrieve a CIM instance and store it in a variable. In the example that follows, instances of the ...

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