On a Windows 2012 R2 virtual machine running under Hyper-V, Task Manager has the ability to display a virtual machine's maximum memory when the virtual machine is using dynamic memory, as shown in the screenshot below.
I've tried navigating through the following classes but I can't find what I need:
- Win32_OperatingSystem (TotalVisibleMemorySize only shows what the VM has consumed so far - not what the maximum is)
- Win32_ComputerSystem (TotalPhysicalMemory only reports the same as TotalVisibleMemorySize above - i.e. the first of the Committed memory values)
Is it possible to programatically query using WMI or Registry to obtain this Maximum Memory value from inside the virtual machine itself?