concept CIM class in category powershell

appears as: CIM class, CIM classes, The CIM class
Windows PowerShell in Action, Third Edition

This is an excerpt from Manning's book Windows PowerShell in Action, Third Edition.

The script starts by defining two hash tables, $dt and $hlth, that will be used to decode the values returned from a CIM class. The variable $IsCoreCLR is used to determine whether the script is running on an instance of PowerShell Core or Windows PowerShell.

CDXML-based cmdlets are created using the cmdlets-over-objects technology introduced in PowerShell v3. In this case, you wrap the CIM class in the appropriate XML and publish as a PowerShell module. The CIM class must be on the remote machine for these cmdlets to work remotely.

Table 16.2. The CIM cmdlets and their purpose compared with the WMI cmdlets

CIM cmdlet

Purpose

Equivalent WMI cmdlet

Get-CimClass Retrieves CIM class structure None
Get-CimInstance Retrieves objects from CIM Get-WmiObject
Get-CimAssociatedInstance Retrieves associated CIM instances None
Invoke-CimMethod Invokes a method on a CIM class Invoke-WmiMethod
New-CimInstance Creates a new instance of a CIM class None
Register-CimIndicationEvent Subscribes to events surfaced through CIM Register-WmiEvent
Remove-CimInstance Removes a CIM instance from the repository Remove-WmiObject
Set-CimInstance Sets the properties of a CIM instance SetWmiInstance