Powershell: PS 7-RC1 WMI Commands not available in Microsoft.PowerShell.Management Module

Created on 16 Jan 2020  路  2Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

(Get-Module Microsoft.PowerShell.Management).ExportedCommands

Expected behavior

Should List:
Get-WMIObject

Actual behavior

Function/Module is not in the list and therefore not availble. Does not import from 5.1 
which is installed, likely due to Module Conflict of Module with same name.

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.1
PSEdition                      Core
GitCommitId                    7.0.0-rc.1
OS                             Microsoft Windows 10.0.18362
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Question Resolution-Answered

All 2 comments

@brad-charboneau the WMI commands have been deprecated since v3 of Windows PowerShell.

This functionality is provided via the CIM cmdlets in both Windows PowerShell v3+ and PowerShell 6+. 馃檪

Most commands using Get-WmiObject can be changed to Get-CimInstance with minimal or zero modification to the command parameters. Some more complex workflows may need a bit more attention, but by and large the CIM cmdlets are a more effective and faster replacement for the WMI cmdlets. 馃檪

Good to know. at now least it is documented here in issue history for any others looking for the answer.

Was this page helpful?
0 / 5 - 0 ratings