@Matt Rosier, Thanks for posting in Q&A. For your command, based on my testing, when I manually run one device, I get error "The property 'InitialSize' cannot be found on this object".
After researching, I find when Pagefile is automatically managed, we can’t modify the setting so we need to remove that box. change the Virtual memory, we need to uncheck "Automatically manage paging file size for all drives".
Here is the code to uncheck the setting:
$pagefile = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges
$pagefile.AutomaticManagedPagefile = $false
$pagefile.put() | Out-Null
After running the above code, I find the virtual memory can be set.
For your scenario, you can try the above suggestion to see if it can work. Hope the above information can help.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentationhttps://learn.microsoft.com/en-us/answers/support/preferences to enable e-mail notifications if you want to receive the related email notification for this thread.