-
Notifications
You must be signed in to change notification settings - Fork 26
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
Switch to CIM cmdlets #8
Comments
Actually this was on my to-do list at one point. I think it's a good idea to switch over given that v3 should be the least version widely used. I suppose a switch parameter could be used in order to leverage WMI, although I'd just prefer to go one way or the other and not have to support both. |
This is a great module and we use it extensively in our organization (along with it's predecessor from Technet Gallery). |
Since PoSH 7.1 is 99% compatbile with PoSH 5.1, it's a shame that the WMI-dependency still exists in this module... |
@bcwilhite if you merge this and someone needs WMI support they can just install the last release before switching to CIM. The current version has been working for people for years, so they should be able to just keep using it. Maybe just putting some explicit install instructions so people understand that to use WMI they use 0.9.0.6, anything after that uses CIM. |
It seems that CIM itself is supported in PowerShell since v3... I.e. natively in Windows 8 and later. So who is actually bound to using WMI if not using an unsupported Windows version? https://devblogs.microsoft.com/scripting/what-is-cim-and-why-should-i-use-it-in-powershell/ https://devblogs.microsoft.com/powershell/introduction-to-cim-cmdlets/ |
@DennisL68 CIM uses WinRM (WSMAN) where WMI uses native WMI calls. I've come across a few scenarios where WMI is enabled, but WinRM is not, and vice-versa. |
Yes, WMI uses RPC where as CIM uses a more controlled protocol as a carrier :) |
It shouldn't be hard to include an option to use WMI as a fallback method. |
Why not just do a regkey check? Check for pending reboot that might be required after a domain joinif (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") { Check for pending computer renameif (Test-Path -Path "HKLM:\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName") { |
Those looking for a work around: $RebootFlags = Test-PendingReboot -Detailed -WarningAction SilentlyContinue -ErrorAction SilentlyContinue if ($RebootFlags.IsRebootPending -eq $true) { |
Hi Brian! As far as I know, WMI cmdlets are considered deprecated. Do you think it's worth to switch to CIM cmdlets? Or implement both and let users to choose which one to use via a switch parameter?
The text was updated successfully, but these errors were encountered: