More CimSession Toolmaking
In the last article, I started demonstrating how you can build your own PowerShell tooling using the CIM .NET classes. While I still recommend using cmdlets like Get-CimInstance
and Get-CimClass
in your functions, advanced scripters may want to build tooling that meets a specific requirement the CIM cmdlets don't address. Today, let's continue to see how we can use the .NET CIM classes to build a custom function that retrieves the CIM-based information.
I'll begin with creating a CimSession
object for the local computer.
$cs =[Microsoft.Management.Infrastructure.CimSession]::Create($env:COMPUTERNAME)
I'm going to focus on getting and enumerating CIM classes and instances.
Want to read the full issue?