Skip to content

Commit

Permalink
Replaced Get-WMIObject with Get-CimInstance for PS7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
vic-basroovers committed May 20, 2020
1 parent f155188 commit 9d14ed5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/collector-generator/New-Collector.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 `
Expand Down

0 comments on commit 9d14ed5

Please sign in to comment.