Merge pull request #523 from basroovers/master

Replace Get-WMIObject with Get-CimInstance for PS7 support
This commit is contained in:
Calle Pettersson 2020-05-20 09:24:16 +02:00 committed by GitHub
commit 245b2b4d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,10 +11,10 @@ Param(
$ErrorActionPreference = "Stop"
if($Credential -ne $null) {
$wmiObject = Get-WMIObject -ComputerName $ComputerName -Credential $Credential -Class $Class
$wmiObject = Get-CimInstance -ComputerName $ComputerName -Credential $Credential -Class $Class
}
else {
$wmiObject = Get-WMIObject -ComputerName $ComputerName -Class $Class
$wmiObject = Get-CimInstance -ComputerName $ComputerName -Class $Class
}
$members = $wmiObject `