mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-28 07:36:37 +00:00
Merge pull request #369 from callvirtual/fix-new-collector
Fix collector creation issue
This commit is contained in:
@@ -17,10 +17,10 @@ else {
|
|||||||
$wmiObject = Get-WMIObject -ComputerName $ComputerName -Class $Class
|
$wmiObject = Get-WMIObject -ComputerName $ComputerName -Class $Class
|
||||||
}
|
}
|
||||||
|
|
||||||
$members = $wmiObject `
|
$members = @($wmiObject `
|
||||||
| Get-Member -MemberType Properties `
|
| Get-Member -MemberType Properties `
|
||||||
| Where-Object { $_.Definition -Match '^u?int' -and $_.Name -NotMatch '_' } `
|
| Where-Object { $_.Definition -Match '^u?int' -and $_.Name -NotMatch '_' } `
|
||||||
| Select-Object Name, @{Name="Type";Expression={$_.Definition.Split(" ")[0]}}
|
| Select-Object Name, @{Name="Type";Expression={$_.Definition.Split(" ")[0]}})
|
||||||
$input = @{
|
$input = @{
|
||||||
"Class"=$Class;
|
"Class"=$Class;
|
||||||
"CollectorName"=$CollectorName;
|
"CollectorName"=$CollectorName;
|
||||||
|
|||||||
Reference in New Issue
Block a user