< Back

Export-VApp

Sun Jan 19, 2020 6:48 pm

NAME Export-VApp



SYNOPSIS

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





SYNTAX

Export-VApp [[-Destination] <String>] [-VApp] <VApp[]> [-CreateSeparateFolder] [-Description <String>] [-Force]

[-Format <VAppStorageFormat>] [-Name <String>] [-RunAsync] [-Server <VIServer[]>] [-Confirm] [-WhatIf]

[<CommonParameters>]



Export-VApp [[-Destination] <String>] [-CreateSeparateFolder] [-Description <String>] [-Force] [-Format

<VAppStorageFormat>] [-Name <String>] [-RunAsync] [-Server <VIServer[]>] -VM <VirtualMachine[]> [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

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.





PARAMETERS

-CreateSeparateFolder [<SwitchParameter>]

Indicates that you want to create a separate folder for each vApp or virtual machine.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Description <String>

Provides a description of the exported vApp or virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Destination <String>

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.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Indicates that the cmdlet overwrites the existing destination files and creates directories to complete the

specified file path.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Format <VAppStorageFormat>

Specifies the file format of the specified vApp or virtual machine. The default format is OVF. The valid

values are OVF and OVA.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a name for the exported vApp or virtual machine.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RunAsync [<SwitchParameter>]

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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Server <VIServer[]>

Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this

parameter, the command runs on the default servers. For more information about default servers, see the

description of Connect-VIServer.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-VApp <VApp[]>

Specifies the vApp that you want to export.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-VM <VirtualMachine[]>

Specifies the virtual machine that you want to export.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,

the cmdlet runs without asking for user confirmation.



Required? false

Position? named

Default value $true

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more FileInfo objects







NOTES









-------------------------- 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 LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... -VApp.html

Get-VApp

Import-VApp

New-VApp

Remove-VApp

Set-VApp

Start-VApp

Stop-VApp

Move-VApp