PowerCli enable Secure Boot

Hi All

I’m creating a script and am stuck at finding the correct solution for enabling Secure Boot (basically so the box is ticked post command)

I’ve managed to set the Firmware to EFI but can’t enable the Secure Boot (EFI Boot Only)

I’ve tried the below to no avail:


$spec = New-Object VMware.Vim.VirtualMachineConfigSpec

$bootOptions = New-Object Vmware.Vim.VirtualMachineBootOptions

$bootOptions.vm.ExtensionData.Config.EfiSecureBootEnabled = $true

$spec.BootOptions = $bootOptions


Version: VMware vSphere PowerCLI 6.0 Release 2 build 3056836


Any help would be much appreciated

Thank you


VMWare docs for this ,


Hi - this doesn’t explain how to configure in PowerCLI format, it only sets the Firmware to EFI

My search hit this result which is an example in VMWare GitHub repo.