Posts tagged: vm

find vms with resource settings and set ram

[powershell]
$vms = Get-VM
foreach ($vm in $vms){
$vmre = $vm | Get-VMResourceConfiguration
if ($vmre.MemLimitMB -ne '-1'){
$rp = $vm | Get-VMResourceConfiguration
$rpvmmb = $rp.MemLimitMB
write-host $vm ", mem granted= " $vm.memorymb ", mem resources = " $rpvmmb
}}
[/powershell]

cooler one to only show when they don't match!

[powershell]
$vms = get-vm
foreach ($vm in $vms){
$vmre = $vm | Get-VMResourceConfiguration
if ($vmre.MemLimitMB -ne '-1'){
$rp = $vm | Get-VMResourceConfiguration
$rpvmmb = $rp.MemLimitMB
if ($vm.memorymb -ne $rpvmmb){
write-host $vm ", mem granted= " $vm.memorymb ", mem resources = " $rpvmmb
}}}
[/powershell]

WordPress Themes