diff --git a/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 b/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 index c2703f8b5..1c60c1cea 100644 --- a/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 +++ b/plugins/providers/hyperv/scripts/utils/VagrantVM/VagrantVM.psm1 @@ -223,6 +223,7 @@ function New-VagrantVMXML { # Determine if secure boot is enabled $SecureBoot = (Select-Xml -XML $VMConfig -XPath "//secure_boot_enabled").Node."#text" + $SecureBootTemplate = (Select-Xml -XML $VMConfig -XPath "//secure_boot_template").Node."#text" $NewVMConfig = @{ Name = $VMName; @@ -242,6 +243,9 @@ function New-VagrantVMXML { if($Gen -gt 1) { if($SecureBoot -eq "True") { Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot On + if(![System.String]::IsNullOrEmpty($SecureBootTemplate)) { + Hyper-V\Set-VMFirmware -VM $VM -SecureBootTemplate $SecureBootTemplate + } } else { Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot Off }