Merge pull request #6419 from uberjew666/master
Fixes SetVirtualMachineSecureBoot function
This commit is contained in:
commit
1be2a6f86a
|
@ -518,8 +518,13 @@ Hyper-V\Set-VMNetworkAdapter -VMName $vmName -MacAddressSpoofing $enableMacSpoof
|
||||||
|
|
||||||
func SetVirtualMachineSecureBoot(vmName string, enableSecureBoot bool, templateName string) error {
|
func SetVirtualMachineSecureBoot(vmName string, enableSecureBoot bool, templateName string) error {
|
||||||
var script = `
|
var script = `
|
||||||
param([string]$vmName, $enableSecureBoot)
|
param([string]$vmName, [string]$enableSecureBootString, [string]$templateName)
|
||||||
Hyper-V\Set-VMFirmware -VMName $vmName -EnableSecureBoot $enableSecureBoot
|
$cmdletParameterExists = Get-Help SetVMFirmware -Parameter SecureBootTemplate -ErrorAction SilentlyContinue
|
||||||
|
if ($cmdletParameterExists) {
|
||||||
|
Hyper-V\Set-VMFirmware -VMName $vmName -EnableSecureBoot $enableSecureBootString -SecureBootTemplate $templateName
|
||||||
|
} else {
|
||||||
|
Hyper-V\Set-VMFirmware -VMName $vmName -EnableSecureBoot $enableSecureBootString
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
var ps powershell.PowerShellCmd
|
var ps powershell.PowerShellCmd
|
||||||
|
|
Loading…
Reference in New Issue