I need to determine how much memory is used by a certain Hyper-V virtual machine. I am interested in the Startup memory amount. Get-VMMemory works, but requires elevation.
It is possible to get the same information using the Hyper-V manager GUI without elavation. Is there a way to get the same information programmatically without elevation?
Option 1
Did you try Exporting the configuration of a virtual machine and then read the required parameters from it? That might be helpful for you.
Option 2
if you can parse the VM config file located at C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines then you can read startup memory amount.
https://www.itprotoday.com/server-virtualization/reading-binary-vmcx-file-windows-2016-hyper-v
You can set the path of virtual machine default folder with this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With