[VMWare] Backup VMWare machines to OVA using PowerCli

After upgrading to VMWare ESXi 6.7, I noticed that you cannot export a VM to OVA anymore (from the GUI).

So… PowerCli to the rescue…

 

First we need the PowerShell Module (More info here: https://www.powershellgallery.com/packages/VMware.PowerCLI/10.0.0.7895300) , and, of course, PowerShell (version 5 recommended).

We install the module: Install-Module -Name VMware.PowerCLI -RequiredVersion 10.0.0.7895300

Then, here’s the script to do it:

 

Now here’s how the table should look like (VMs.csv file)

Name
VM1
VM2

Note that if you have an ISO file attached to the VM, it will also be exported.