Hyper-V 2012 host
Server 2012 R2 guest
The guest is configured for startup and minimum memory of 2 GB with a maximum memory of 64 GB. Once per day a PowerShell script runs which uses 7-Zip.exe to compress some large files. The 7-Zip command fails if there is less than 10 GB of memory immediately available. I do not want to allocate that much minimum memory to the guest, as it doesn't need it for anything but this one script.
How can I programmatically request or instruct the host to allocate 10 GB to the guest before I run the 7zip command?
Currently I am launching a PowerShell job running Sysinternals TestLimit64.exe and running it until I see the allocated memory go up on the host. But this workaround is inelegant, inexact, imprecise, and slow.
Thank you.
Tim Curwick
MadWithPowerShell.com