PSCertificateEnrollment
PSCertificateEnrollment copied to clipboard
Get-WmiObject and PowerShell 7
trafficstars
Get-WmiObject is not supported in PowerShell 7, the existence of the Cmdlet should be checked before it is used and, if not found, Get-CimInstance should be used instead (or the other way around).
Example:
if(Get-Command 'Get-CimInstance' -ErrorAction SilentlyContinue) {
# Use Get-CimInstance
} else {
# Use Get-WmiObject
}
Thanks very much for your contribution. I have not yet tested the module on PS higher than 5.x. I will make sure it'll work correctly with the next release. May I ask how your experience is so far with the module?
It was exactly what I was looking for but I'm only using a few Cmdlets. I had started to write almost the exact same Cmdlets myself before finding yours.