Fix if statement to use '-and' syntax
Docs for powershell: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logical_operators?view=powershell-7
This commit is contained in:
parent
75253b41bb
commit
e3223b67ff
@ -243,9 +243,13 @@ function New-VagrantVMXML {
|
||||
if($Gen -gt 1) {
|
||||
if($SecureBoot -eq "True") {
|
||||
Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot On
|
||||
if(![System.String]::IsNullOrEmpty($SecureBootTemplate) && (Get-Command Hyper-V\Set-VMFirmware).Parameters.Keys.Contains("secureboottemplate")) {
|
||||
Hyper-V\Set-VMFirmware -VM $VM -SecureBootTemplate $SecureBootTemplate
|
||||
}
|
||||
if (
|
||||
( ![System.String]::IsNullOrEmpty($SecureBootTemplate) )`
|
||||
-and`
|
||||
( (Get-Command Hyper-V\Set-VMFirmware).Parameters.Keys.Contains("secureboottemplate") )
|
||||
) {
|
||||
Hyper-V\Set-VMFirmware -VM $VM -SecureBootTemplate $SecureBootTemplate
|
||||
}
|
||||
} else {
|
||||
Hyper-V\Set-VMFirmware -VM $VM -EnableSecureBoot Off
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user