For installed RAM you want:
Get-WmiObject Win32_PhysicalMemory | Where {$_.MemoryType -ge 20} |
Measure Capacity -sum
Look at this MSDN page for more info on MemoryType.
For the MAX amount of RAM the system will handle, I think this is supposed to get you that. However, I don't think that means the OS or the motherboard would necessarily handle that much memory. I see nothing on the Win32_MotherboardDevice that shows max RAM.
Get-WmiObject Win32_PhysicalMemoryArray | Where {$_.Use -eq 3} |
Foreach {($_.MaxCapacity*1KB)/1GB}
Here's the MSDN page for Win32_PhysicalMemoryArray.