VMware Cloud Community
denjoh44
Enthusiast
Enthusiast

Powershell command for change boot options bios to efi

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

7 Replies
LucD
Leadership
Leadership

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

LucD
Leadership
Leadership

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)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

denjoh44
Enthusiast
Enthusiast

Hello,

I will be trying your command luc tomorrow

I inform you of the result

thanks

0 Kudos
denjoh44
Enthusiast
Enthusiast

It is exactly that I wanted, luc

Thank you for your help

0 Kudos
dwchan
Enthusiast
Enthusiast

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

0 Kudos
LucD
Leadership
Leadership

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
dwchan
Enthusiast
Enthusiast

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

0 Kudos