mirror of
https://github.com/prometheus-community/windows_exporter
synced 2024-12-26 08:22:07 +00:00
Replaced Get-WMIObject with Get-CimInstance for PS7 support
This commit is contained in:
parent
99ed969bf7
commit
7742ff6a1c
@ -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