icinga-powershell-framework/lib/provider/memory/Get-IcingaMemoryUsage.psm1
2019-07-25 18:31:08 +02:00

14 lines
566 B
PowerShell

function Get-IcingaMemoryUsage()
{
$MEMUsageInformations = Get-CimInstance Win32_OperatingSystem;
[hashtable]$MEMUsageData = @{
'FreePhysicalMemory' = $MEMUsageInformations.FreePhysicalMemory;
'FreeVirtualMemory' = $MEMUsageInformations.FreeVirtualMemory;
'TotalVirtualMemorySize' = $MEMUsageInformations.TotalVirtualMemorySize;
'TotalVisibleMemorySize' = $MEMUsageInformations.TotalVisibleMemorySize;
'MaxProcessMemorySize' = $MEMUsageInformations.MaxProcessMemorySize;
}
return $MEMUsageData;
}