POWERSHLL MEMORY (RAM) TOTAL MEMORY / USED MEMORY / FREE MEMORY / USAGE(%)
Kbyte값으로 표시
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$OperatingSystem = Get-WmiObject win32_OperatingSystem -computer localhost $FreeMemory = $OperatingSystem.FreePhysicalMemory $TotalMemory = $OperatingSystem.TotalVisibleMemorySize $MemoryUsed = ($TotalMemory - $FreeMemory) $MemoryUsed1 = (100 - ($FreeMemory/ $TotalMemory) * 100) #$PercentMemoryUsed = "{0:N1}" -f $MemoryUsed $PercentMemoryUsed = "{0:N1}" -f $MemoryUsed1 Write-Host "TOTAL_RAM=$TotalMemory" Write-Host "FREE_RAM=$FreeMemory" Write-Host "USED_RAM=$MemoryUsed" Write-Host "RAM_PER=$PercentMemoryUsed" |
결과값
1 2 3 4 |
TOTAL_RAM=33476316 FREE_RAM=13382780 USED_RAM=20093536 RAM_PER=60.0 |