# Get-FreeMemory.ps1
# Sample using PowerShell
# 1st sample from http://msdn.microsoft.com/en-us/library/aa394587
# Thomas Lee
$mem = Get-WmiObject -Class Win32_OperatingSystem
# Display memory
"System : {0}" -f $mem.csname
"Free Memory: {0}" -f $mem.FreePhysicalMemory
This script produces the following output:
PS C:\foo> .\get-freememory.ps1
System : COOKHAM8
Free Memory: 2776988


0 comments:
Post a Comment