icinga-powershell-framework/lib/provider/memory/Get-IcingaMemoryPerformanceCounter.psm1

14 lines
428 B
PowerShell
Raw Normal View History

2019-07-25 12:29:21 -04:00
function Get-IcingaMemoryPerformanceCounter()
{
$MemoryStart = (Show-IcingaPerformanceCounters -CounterCategory 'Memory');
2019-07-25 12:29:21 -04:00
$MemoryCounter = New-IcingaPerformanceCounterArray -Counter $MemoryStart;
[hashtable]$Result = @{};
foreach ($item in $MemoryCounter.Keys) {
$counter = $item.trimstart('\Memory\');
$Result.Add($counter, $MemoryCounter[$item]);
}
return $Result;
}