With the availability of dynamic memory in Windows Server 2008 R2 SP1 there are some changes to how you need to handle memory as a scripter / developer. The WMI API changes are now documented here.
Most of the changes are fairly obvious – but two not so obvious properties are the properties for the “Startup RAM” and “Maximum RAM”. In WMI these are mapped to “VirtualQuantity” and “Limit” respectively.
Here is a sample script that simply displays the memory configuration of the specified virtual machine.
[Source]