Information
The guest OS must enable Secure Boot. Secure Boot, supported by all modern guest OSes, uses public key cryptography to validate firmware, boot loader, drivers, and OS kernel. By preventing system booting with uncertain boot chain validity, it effectively restricts malware.
Solution
$VMobj = (Get-VM -Name $VM)
$ConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$bootOptions = New-Object VMware.Vim.VirtualMachineBootOptions
$bootOptions.EfiSecureBootEnabled = $true
$ConfigSpec.BootOptions = $bootOptions
$task = $VMobj.ExtensionData.ReconfigVM_Task($ConfigSpec)