List PerformanceCounter for Memory

This commit is contained in:
Niko Martini 2019-07-25 18:29:21 +02:00
parent 54499cae4c
commit ae7d104d5a

View file

@ -0,0 +1,13 @@
function Get-IcingaMemoryPerformanceCounter()
{
$MemoryStart = (Show-IcingaPerformanceCounters -CounterCategory 'Memory').Keys;
$MemoryCounter = New-IcingaPerformanceCounterArray -Counter $MemoryStart;
[hashtable]$Result = @{};
foreach ($item in $MemoryCounter.Keys) {
$counter = $item.trimstart('\Memory\');
$Result.Add($counter, $MemoryCounter[$item]);
}
return $Result;
}