Powershell 7 is missing Get-Wmiobject

I have installed Powershell 7 and run it side-by-side with PS 5.1 ISE. I am migrating my PS 5.1 scripts to PS7. One obstacle I ran into was that the cmdlet

Get-wmiobject win32_logicaldisk ...

no longer works. Powershell 7 considers it an invalide name of a cmdlet. I am lost on where to obtain this missing cmdlet. Would be grateful for any advice or tips. Thanks.

Powershell 7 is based on .Net Core and .Net Core does not support WMI. You will have to use CIM instead.

Get-CimInstance win32_logicaldisk 

1 Like

My sincere thanks Olaf …

The WMI cmdlets must have been deprecated in PS 7, but you can still work with WMI/CIM using cmdlets from the cimcmdlets module in PS 7.

get-command -module cimcmdlets

get-command -module cimcmdlets |measure

 

get-ciminstance is almost the same as get-wmiobject. Except with remote computers it uses wsman instead of dcom.