trying to build a VM to deploy Win11 to, it builds the VM fine but upon starting it, I get "no compatible bootloader found"
This is for windows 11, so involves TPM, securebooot, and EFI as well. When building the VM from GUI, it seems to work fine, but am trying to use powershell. Any help would be greatly appreciated. I am wondering if I am missing an option or an setting.
$Name = "Win11-builder"
$vmHost = "vmHost"
$dStore = "Datastore"
$pg = "PortGroup"
$isoPath = '[thisDtastore] Win11iso/Win11_English_x64v1.iso'
$myTargetVMHost = Get-VMHost -Name $vmHost -Server $ipc
$policy = Get-SpbmStoragePolicy 'VM Encryption Policy' -Server $ipc
New-VM -Name $Name -ResourcePool $myTargetVMHost -Datastore $dStore -NumCPU 2 -MemoryGB 8 -DiskGB 120 -Portgroup $pg -CD -StoragePolicy $policy -SkipHardDisks -RunAsync
sleep 2
get-vm $Name | New-VTpm
$vm = get-vm $Name
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.Firmware = [VMware.Vim.GuestOsDescriptorFirmwareType]::efi
$spec.NestedHVEnabled = $true
$boot = New-Object VMware.Vim.VirtualMachineBootOptions
$boot.EfiSecureBootEnabled = $true
$spec.BootOptions = $boot
$flags = New-Object VMware.Vim.VirtualMachineFlagInfo
$flags.VbsEnabled = $true
$flags.VvtdEnabled = $true
$spec.flags = $flags
$vm.ExtensionData.ReconfigVM($spec)
#>
start-vm $Name
sleep 2
$cd = Get-VM -Name $Name | Get-CDDrive| Set-CDDrive -Connected $true -IsoPath $isoPath -StartConnected $true -Confirm:$false