Move dynamic memory settings into conditional block

This commit is contained in:
Brian Retford 2016-10-14 18:53:44 -07:00
parent 48cf314c90
commit 418064519d
1 changed files with 1 additions and 1 deletions

View File

@ -97,11 +97,11 @@ if (!$switchname) {
Connect-VMNetworkAdapter -VMNetworkAdapter (Get-VMNetworkAdapter -VM $vmConfig.VM) -SwitchName $switchname
Set-VM -VM $vmConfig.VM -NewVMName $vm_name -MemoryStartupBytes $MemoryStartupBytes
Set-VM -VM $vmConfig.VM -MemoryMinimumBytes $MemoryMinimumBytes -MemoryMaximumBytes $MemoryMaximumBytes
Set-VM -VM $vmConfig.VM -ErrorAction "Stop" -ProcessorCount $processors
If ($dynamicmemory) {
Set-VM -VM $vmConfig.VM -DynamicMemory
Set-VM -VM $vmConfig.VM -MemoryMinimumBytes $MemoryMinimumBytes -MemoryMaximumBytes $MemoryMaximumBytes
} else {
Set-VM -VM $vmConfig.VM -StaticMemory
}