WMI doesn't have this problem either.
 Code:
$memcol = GetObject("winmgmts:\\.\root\cimv2").InstancesOf("Win32_MemoryArray")
For Each $mem in $memcol
  ? $mem.EndingAddress
Next


Returns the total amount of memory