PowerCLI

 View Only
  • 1.  Powershell command for change boot options bios to efi

    Posted Sep 26, 2013 04:11 PM

    Hi,

    i 'm in vsphere 5.0, i must deploy Windows 2012 so i must change the boot options in my vms

    i would change the boot options bios to efi

    if i pass this command

    $xy=get-vm -name xxxx -location yyy |get-view

    $xy.config.firmware   give me

    bios

    i tried this command powershell, but it's not good

    get-vm -name xxxx -location yyy |get-view | foreach-object {$_.Config.Firmware("efi")}

    but it's not good

     

    can you help me



  • 2.  RE: Powershell command for change boot options bios to efi

    Posted Sep 26, 2013 04:29 PM

    Have a look at Change VM Boot Order via PowerShell, that is the method to change the bootorder.

    But it doesn't look as if EFI is an option you can select.

    Even the 5.5 VirtualMachineBootOptionsBootableDevice object doesn't seem to have that option.



  • 3.  RE: Powershell command for change boot options bios to efi

    Posted Sep 26, 2013 05:18 PM

    Update, I was too fast with my conclusion.

    To change the firmware from BIOS to EFI you can do

    $vm = Get-VM TestVM

    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $spec.Firmware = [VMware.Vim.GuestOsDescriptorFirmwareType]::efi
    $vm.ExtensionData.ReconfigVM($spec)


  • 4.  RE: Powershell command for change boot options bios to efi

    Posted Sep 26, 2013 06:23 PM

    Hello,

    I will be trying your command luc tomorrow

    I inform you of the result

    thanks



  • 5.  RE: Powershell command for change boot options bios to efi

    Posted Sep 28, 2013 07:19 AM

    It is exactly that I wanted, luc

    Thank you for your help



  • 6.  RE: Powershell command for change boot options bios to efi

    Posted Nov 10, 2020 06:08 AM

    How do you change the boot order with an UEFI machine?  I have the code for BIOS base VM, but I presume the syntax is different for UEFI VM



  • 7.  RE: Powershell command for change boot options bios to efi

    Posted Nov 10, 2020 10:33 AM

    Please open a new thread for a new question.
    Make sure you are in the correct community!



  • 8.  RE: Powershell command for change boot options bios to efi

    Posted Nov 10, 2020 03:28 PM

    I will open up a new thread.  Thank you in advance