support/hyperv.ps1 in kitchen-hyperv-0.4.1 vs support/hyperv.ps1 in kitchen-hyperv-0.5.0
- old
+ new
@@ -57,10 +57,11 @@
[cmdletbinding()]
param (
$Generation = 1,
$DisableSecureBoot,
$MemoryStartupBytes,
+ $StaticMacAddress,
$Name,
$Path,
$VHDPath,
$SwitchName,
$VlanId,
@@ -72,10 +73,11 @@
$EnableGuestServices,
$AdditionalDisks
)
$null = $psboundparameters.remove('DisableSecureBoot')
$null = $psboundparameters.remove('ProcessorCount')
+ $null = $psboundparameters.remove('StaticMacAddress')
$null = $psboundparameters.remove('UseDynamicMemory')
$null = $psboundparameters.remove('DynamicMemoryMinBytes')
$null = $psboundparameters.remove('DynamicMemoryMaxBytes')
$null = $psboundparameters.remove('boot_iso_path')
$null = $psboundparameters.remove('EnableGuestServices')
@@ -94,9 +96,12 @@
else {
$vm | Set-VMMemory -DynamicMemoryEnabled $false
}
if (-not [string]::IsNullOrEmpty($boot_iso_path)) {
Mount-VMISO -Id $vm.Id -Path $boot_iso_path
+ }
+ if ($StaticMacAddress -ne $null) {
+ Set-VMNetworkAdapter -VMName $vm.VMName -StaticMacAddress $StaticMacAddress
}
if ($EnableGuestServices -and (Get-command Enable-VMIntegrationService -ErrorAction SilentlyContinue)) {
Enable-VMIntegrationService -VM $vm -Name 'Guest Service Interface'
}
if (($VlanId -ne $null) -and (Get-command Set-VMNetworkAdapterVlan -ErrorAction SilentlyContinue)) {