Export-VApp Command | Vmware PowerCLI Reference

Export-VApp

This cmdlet exports a vApp or a single virtual machine to the specified destination. If no destination is specified, the cmdlet creates a new folder in the current working directory and exports the vApp or the virtual machine to it. The name of the new folder is the same as the name of the vApp or the virtual machine as it appears in vCenter Server.

Syntax

Export-VApp
[ -VApp ] < VApp[] >
[-CreateSeparateFolder ]
[-Description < String > ]
[-Destination < String > ]
[-Force ]
[-Format < VAppStorageFormat > ]
[-Name < String > ]
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-SHAAlgorithm < SHAAlgorithm > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VApp VApp[] 1
  • pipeline
  • wildcards
Specifies the vApp that you want to export.
optional CreateSeparateFolder SwitchParameter named
Indicates that you want to create a separate folder for each vApp or virtual machine.
optional Description String named
Provides a description of the exported vApp or virtual machine.
optional Destination String named
Specifies a destination path to the file system location where you want to export the vApp or the virtual machine. If the value of the Destination parameter is a folder, the vApp or the virtual machine is exported to a container folder (OVF). If the destination is a file, the vApp or the virtual machine is exported in OVA format.
optional Force SwitchParameter named
Indicates that the cmdlet overwrites the existing destination files and creates directories to complete the specified file path.
optional Format VAppStorageFormat named
Specifies the file format of the specified vApp or virtual machine. The default format is OVF. The valid values are OVF and OVA.
optional Name String named
Specifies a name for the exported vApp or virtual machine.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console.
optional SHAAlgorithm SHAAlgorithm named
Specifies the hashing algorithm that you want to use in the manifest checksums. The default value is SHA256. The valid values are SHA256 and SHA1.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.
Export-VApp
[-CreateSeparateFolder ]
[-Description < String > ]
[-Destination < String > ]
[-Force ]
[-Format < VAppStorageFormat > ]
[-Name < String > ]
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-SHAAlgorithm < SHAAlgorithm > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VM VirtualMachine[] named
  • pipeline
Specifies the virtual machine that you want to export.
optional CreateSeparateFolder SwitchParameter named
Indicates that you want to create a separate folder for each vApp or virtual machine.
optional Description String named
Provides a description of the exported vApp or virtual machine.
optional Destination String named
Specifies a destination path to the file system location where you want to export the vApp or the virtual machine. If the value of the Destination parameter is a folder, the vApp or the virtual machine is exported to a container folder (OVF). If the destination is a file, the vApp or the virtual machine is exported in OVA format.
optional Force SwitchParameter named
Indicates that the cmdlet overwrites the existing destination files and creates directories to complete the specified file path.
optional Format VAppStorageFormat named
Specifies the file format of the specified vApp or virtual machine. The default format is OVF. The valid values are OVF and OVA.
optional Name String named
Specifies a name for the exported vApp or virtual machine.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter, run "help About_RunAsync" in the VMware PowerCLI console.
optional SHAAlgorithm SHAAlgorithm named
Specifies the hashing algorithm that you want to use in the manifest checksums. The default value is SHA256. The valid values are SHA256 and SHA1.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.

Output

System.IO.FileInfo

Examples

Example 1

Get-VApp -Name "MyVApp*" | Export-VApp -Destination "C:\vapps\"

Retrieves all vApps whose names start with "MyVApp" and exports them to the specified path.

Example 2

$myVApp = Get-VApp -Name "MyVApp1"
Export-VApp -Destination "C:\NewFolder\" -VApp $myVApp -Name "EMail_vApp" -Force

Exports the vApp in the $myVApp variable to the specified location and assigns a name to the folder.

Example 3

$myVApp = Get-VApp -Name "MyVApp1"
Export-VApp -vApp $myVApp -Destination "C:\vapps\Vapp\" -Force -CreateSeparateFolder:$false

Exports the vApp in the $myVApp variable to the specified location without creating a separate folder for each virtual appliance.

Example 4

$myVApp = Get-VApp -Name "MyVApp1"
Export-VApp -vApp $myVApp -Destination "C:\vapps\myVapp\" -Format Ova

Exports a vApp in OVA format.

Example 5

Get-VM -Name MyVM* | Export-VApp -Destination "C:\MyVMs\"

Retrieves all virtual machines whose names start with "MyVM" and exports them to the specified path.

Example 6

$myVM = New-VM -Name MyVM1 -VMHost MyVMHost1
Export-VApp -Destination "C:\MyVMs\" -VM $myVM -Format Ova

Creates a new virtual machine and exports it in OVA format.

Example 7

$myVM = New-VM -Name "MyVM1" -VMHost MyVMHost1
Get-VM -Name MyVM | Export-VApp -Destination "C:\MyVMs\"
Export-VApp -Destination "C:\MyVMs\" -VM $myVM -Force

Exports a virtual machine to the same path twice. The second time forces an override of the previously exported files.

Related Commands

VApp

This cmdlet exports a vApp or a single virtual machine to the specified destination.

This cmdlet retrieves vApps.

This cmdlet imports OVF (Open Virtualization Format) and OVA packages. The package can contain a virtual appliance or a virtual machine.

This cmdlet moves the specified virtual appliances to a new location.

This cmdlet creates a new vApp.

This cmdlet removes vApps from the server.

This cmdlet modifies the specified vApp.

This cmdlet starts vApps.

This cmdlet stops vApps.