Q: How can I use PowerShell to view the BIOS/firmware configuration of my Hyper-V virtual machines?

A: Hyper-V 2012 R2 supports two types of virtual machine:

  • Generation 1: BIOS based
  • Generation 2: UEFI based

To view the BIOS configuration of a Generation 1 virtual machine, use the Get-VMBios <VM> cmdlet (and use Set-VMBios to configure settings). This command's output is shown below:

  1. PS C:\> Get-VMBIOS Gen1VM | fl
  2.  
  3. ComputerName   : SAVDALHV20
  4. NumLockEnabled : False
  5. StartupOrder   : {CD, IDE, LegacyNetworkAdapter, Floppy}
  6. VMId           : c418cc87-4db2-4a38-ae5c-9ebd075fdf04
  7. VMName         : Gen1VM
  8. VMSnapshotId   : 00000000-0000-0000-0000-000000000000
  9. VMSnapshotName :
  10. Key            :
  11. IsDeleted      : False

To view the firmware configuration of a Generation 2 virtual machine, use the Get-VMFirmware <VM> cmdlet (and use Set-VMFirmware to configure settings). This command's output is shown below:

  1. PS C:\> Get-VMFirmware Gen2VM | fl
  2.  
  3. ComputerName                 : SAVDALHV20
  4. SecureBoot                   : On
  5. PreferredNetworkBootProtocol : IPv4
  6. BootOrder                    : {File, Drive, Drive, Network}
  7. VMId                         : 514dc058-e4b3-4c91-9c5c-824930895035
  8. VMName                       : Gen2VM
  9. VMSnapshotId                 : 00000000-0000-0000-0000-000000000000
  10. VMSnapshotName               :
  11. Key                          :
  12. IsDeleted                    : False