Quantcast
Viewing all articles
Browse latest Browse all 185574

Set Memory Reservation & Limit For List Of VMs

Can someone help me write a script on how to set the memory reservation and limit for a list of VMs from a text file. My lab is down right so I can't test my script to see if it works but i desperately need to make the change in production. I would be glad if anyone can tell me if they see anything wrong with it or any advice or input. Thanks Image may be NSFW.
Clik here to view.

 

Get-Content -Path C:\tmp\VMList.txt | ForEach-Object {
  Get-VM -Name  $_ | `
  Get-VMResourceConfiguration | `
  Set-VMResourceConfiguration -MemReservationMB 1024 -MemLimitMB 2048
}

 

 

VMList.txt

 

vm1

vm2

vm3

vm4

vm5


Viewing all articles
Browse latest Browse all 185574

Trending Articles