Skip to content

Commit

Permalink
Merge pull request prometheus-community#523 from basroovers/master
Browse files Browse the repository at this point in the history
Replace Get-WMIObject with Get-CimInstance for PS7 support
  • Loading branch information
carlpett authored May 20, 2020
2 parents f155188 + 9d14ed5 commit 1380d59
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 1380d59

Please sign in to comment.