

PS6> $myDatastore = Get-Datastore -Name "MyDatastore1" You can then use both objects to pass to the Import-Vapp cmdlet to import it. To do so, you’ll need to query the datastore to import it into along with the VM host. You should now have a file sitting on your local file system. When complete, you should have an appliance ready to be deployed into another vCenter environment. This process will take a few minutes, and wasn’t a very large appliance to begin with. With the template appliance now offline, resume running the Export-VApp cmdlet attempted earlier. PS6> Shutdown-VMGuest -VM 'My_VM_Template'
#EXPORT VM TO OVF VMWARE WORKSTATION CODE#
Modify your code a little more and be sure to first shut down the VM using the Shutdown-VMGuest cmdlet. You cannot export a running VM to an OVF. PS6> Export-VApp -VM 'My_VM_Template' -Destination 'C:\Exported-OVF\'īut there’s an issue. Knowing this, you can then run Export-VApp against the VM template specifying the destination folder. I already have a path in mind so I’m going to be using the C:\Exported-OVF directory but yours may vary. The Export-VApp cmdlet will export the powered off VM as an OVF to the current directory you session is in by default if you do not specify a path.


But first, since this is a learning experience for me and maybe you, I’ll educate myself a little more on the proper use for each. You can do this using the Get-Command -Module PowerCLI cmdlet.īoth of these cmdlets appear to be exactly what you need. Once you’ve connected, you need to know what verbs to use. I gathered the necessary information from my colleague, and began connecting to the cluster: PS6> Connect-VIServer -Server -Credential ( Get-Credential) Never wanting to miss a chance to use PowerShell or PowerCLI, I jumped in head first to help.
