support/hyperv.ps1 in kitchen-hyperv-0.1.4 vs support/hyperv.ps1 in kitchen-hyperv-0.1.5
- old
+ new
@@ -50,13 +50,14 @@
$VHDPath,
$SwitchName,
$ProcessorCount
)
$null = $psboundparameters.remove('ProcessorCount')
- new-vm @psboundparameters |
- Set-Vm -ProcessorCount $ProcessorCount -passthru |
- Start-Vm -passthru |
+ $vm = new-vm @psboundparameters |
+ Set-Vm -ProcessorCount $ProcessorCount -passthru
+ $vm | Set-VMMemory -DynamicMemoryEnabled $false
+ $vm | Start-Vm -passthru |
foreach {
$vm = $_
do {
start-sleep -seconds 2
} while ($vm.state -notlike 'Running')
@@ -137,10 +138,10 @@
}
}
function Get-DefaultVMSwitch
{
- Get-VMSwitch | Select -First 1
+ Get-VMSwitch | Select -First 1 | Select Name, Id
}
function Mount-VMISO {
[cmdletbinding()]
param($Id, $Path)
\ No newline at end of file