- Run Windows PowerShell as Administrator
- Install PoweCLI: Install-Module -Name VMware.PowerCLI
- Alternatively, you can download PowerCLI from here: https://code.vmware.com/tool/vmware-powercli
- Create a folder where you want to export the virtual machine. I’ll use the OVA format in this example. Note the path to the folder.
- Run PowerCLI as Administrator
- Load the PowerCLI module: Import-Module VMware.PowerCLI
- Connect to vCenter: Connect-VIServer <vCenter name>
- Enter credentials
- Export the virtual machine: Get-VM “VM name” | Export-VApp -Destination “<folder name\file name>” -Format OVA
- Alternatively, you can export to OVF format
- Import the virtual machine: Import-VApp “<absolute path\file name>” -VMhost “<host name as it appears in vCenter>”
- Optional parameters
- -Datastore “<data store name>”
- -DiskStorageFormat Thin
- Optional parameters