mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-01-19 13:51:23 +00:00
Merge pull request #523 from basroovers/master
Replace Get-WMIObject with Get-CimInstance for PS7 support
This commit is contained in:
commit
245b2b4d28
@ -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 `
|
||||
|
Loading…
Reference in New Issue
Block a user