How to Disable Secure Boot in Hyper-V with PowerShell

If you're creating Linux VMs in Hyper-V, you need to disable SecureBoot. You can do this in bulk.

Get-VM | Set-VMFirmware -EnableSecureBoot Off

If you want to do that for a specific VM you can use the -VMName flag.

Set-VMFirmware -VMName <VMName> -EnableSecureBoot Off