Replaced Get-WMIObject with Get-CimInstance for PS7 support

This commit is contained in:
Bas Roovers 2020-05-20 08:48:53 +02:00
parent 99ed969bf7
commit 7742ff6a1c
1 changed files with 2 additions and 2 deletions

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 `