Documentation Index
Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
Use this file to discover all available pages before exploring further.
powershell/PSAvoidUsingWMICmdlet is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | PSScriptAnalyzer |
| Auto-fix | No |
Description
As of PowerShell 3.0, the CIM cmdlets should be used over the WMI cmdlets. The following cmdlets should not be used:Get-WmiObjectRemove-WmiObjectInvoke-WmiMethodRegister-WmiEventSet-WmiInstance
Get-CimInstanceRemove-CimInstanceInvoke-CimMethodRegister-CimIndicationEventSet-CimInstance
How
Change to the equivalent CIM-based cmdlet.Get-WmiObject->Get-CimInstanceRemove-WmiObject->Remove-CimInstanceInvoke-WmiMethod->Invoke-CimMethodRegister-WmiEvent->Register-CimIndicationEventSet-WmiInstance->Set-CimInstance