You want the Win32_OperatingSystem namespace, and it's TotalVisibleMemorySize (physical memory), FreePhysicalMemory, TotalVirtualMemorySize, and FreeVirtualMemory properties.
Get-WmiObject win32_OperatingSystem |%{"Total Physical Memory: {0}KB`nFree Physical Memory : {1}KB`nTotal Virtual Memory : {2}KB`nFree Virtual Memory : {3}KB" -f $_.totalvisiblememorysize, $_.freephysicalmemory, $_.totalvirtualmemorysize, $_.freevirtualmemory}
That will spit back:
Total Physical Memory: 4079572KB
Free Physical Memory : 994468KB
Total Virtual Memory : 8157280KB
Free Virtual Memory : 3448916KB
I'm sure you can do the math if you want to get Used instead of Free.
Edit: Your CPULoad Average isn't really an average of anything. Case in point:
For($a=1;$a -lt 30;$a++){
Get-WmiObject win32_processor|ForEach{
[pscustomobject][ordered]@{
'Average' = $_ | Measure-Object -property LoadPercentage -Average | Select -expand Average
'Current' = $_ | select -expand LoadPercentage
}
}
Start-Sleep -Milliseconds 50
}
Results:
Average CPU Load
------- --------
2 2
1 1
1 1
1 1
1 1
5 5
1 1
1 1
0 0
1 1
1 1
1 1
2 2
4 4
0
1 1
7 7
24 24
1 1