Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMIObject deprication #208

Open
markszili opened this issue Feb 5, 2024 · 6 comments
Open

WMIObject deprication #208

markszili opened this issue Feb 5, 2024 · 6 comments

Comments

@markszili
Copy link

Have noticed that many of the commadlets use WMIObject instead of CIMInstace.

Considering WMI is getting closer to deprecation it would be worth overhauling all the query commands to CIM

@rzander
Copy link
Owner

rzander commented Feb 6, 2024

Do you possess an official statement or link confirming the deprecation of WMIObject with PowerShell 5 ?!

@markszili
Copy link
Author

markszili commented Feb 6, 2024

Do you possess an official statement or link confirming the deprecation of WMIObject with PowerShell 5 ?!

Not in so many words just yet, but the writing is on the wall.
https://techcommunity.microsoft.com/t5/windows-it-pro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/ba-p/4039242

https://twitter.com/jarwidmark/status/1751002076379803898

Best to start now updating to CIM than having to rush when it needs to happen.
I stopped using WMI back in 2016 so I did not have to worry.

@rzander
Copy link
Owner

rzander commented Feb 6, 2024

WMIC is a Command-Line Tools ... it has nothing to do with WMIObjects vs CIMInstance. Client Center does not depend on WMIC.

@markszili
Copy link
Author

WMIC is a Command-Line Tools ... it has nothing to do with WMIObjects vs CIMInstance. Client Center does not depend on WMIC.

I have not been able to find an infomation to confirm that however. Even though the command such as Get-WMIObject still exists in 5.1, documention for that command says depricated in Powershell 3.0 and the use Get-CIMInstance instead.
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-wmiobject?view=powershell-5.1#description

@markszili
Copy link
Author

WMIC is a Command-Line Tools ... it has nothing to do with WMIObjects vs CIMInstance. Client Center does not depend on WMIC.

So to verify that Get-WmiObject no longer works you can test this by removing the WMIC optional feature in the latest version of Windows 11

  1. Confirm WMIC is working in powershell e.g. Get-WmiObject -Class Win32_Bios | Format-List -Property *
  2. got to Settings > System > Optional Features
  3. Find and remove WMIC
  4. Restart PC
  5. Open Powershell and attempt to Run command again and you will see Get-WmiObject is no longer accepted.
    Get-WmiObject -Class Win32_Bios | Format-List -Property *

As such we can confirm any application that still calls Get-WmiObject is dependent on WMIC Optional Feature installed.

@rzander
Copy link
Owner

rzander commented Feb 6, 2024

If Get-WmiObject really depends on the WMIC Optional Feature then things will get hectic in support as many scripts depend on Get-WMIObject...
I'm aware that Get-WMIObject is depreciated in PowerShell 6 an higher.. but most companies are still on PowerShell 5 /which is installed by default)...

But to make is short, there are no plans to refacture ClientCenter.... In worst case it will die with Get-WMIObject ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants