PowerShell WMI and CIM



As of PowerShell 3.0, there are two ways to work with management classes in PowerShell, WMI and CIM. PowerShell 1.0 and 2.0 only supported the WMI-module which is now superseeded by the new and improved CIM-module. In a later release of PowerShell, the WMI-cmdlets will be removed.

Comparison of CIM and WMI-modules:

CIM-cmdletWMI-cmdletWhat it does
Get-CimInstanceGet-WmiObjectGets CIM/WMI-objects for a class
Invoke-CimMethodInvoke-WmiMethodInvokes a CIM/WMI-class method
Register-CimIndicationEventRegister-WmiEventRegisters event for a CIM/WMI-class
Remove-CimInstanceRemove-WmiObjectRemove CIM/WMI-object
Set-CimInstanceSet-WmiInstanceUpdates/Saves CIM/WMI-object
Get-CimAssociatedInstanceN/AGet associated instances (linked object/classes)
Get-CimClassGet-WmiObject -ListList CIM/WMI-classes
New-CimInstanceN/ACreate new CIM-object
Get-CimSessionN/ALists CIM-sessions
New-CimSessionN/ACreate new CIM-session
New-CimSessionOptionN/ACreates object with session options; protocol, encoding, disable encryption etc. (for use with New-CimSession)
Remove-CimSessionN/ARemoves/Stops CIM-session

Additional resources

Should I use CIM or WMI with Windows PowerShell? @ Hey, Scripting Guy! Blog