Get-OvfConfiguration Command | Vmware PowerCLI Reference

Get-OvfConfiguration

This cmdlet retrieves the OVF configuration object from the specified OVF, OVA, or content library item. Only user-configurable properties are returned.

Syntax

Get-OvfConfiguration
[ -Target ] < VIContainer >
-ContentLibraryItem < ContentLibraryItem >
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Target VIContainer 1
Specifies the location (target) to which you want to deploy the OVF package. The target can be a an object of type VMHost, ResourcePool, Cluster, or VApp.
required
ContentLibraryItem ContentLibraryItem named
  • pipeline
Specifies the content library item to retrieve the OVF configuration from.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null 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.
Get-OvfConfiguration
-Ovf < String >
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Ovf String named
  • wildcards
Specifies the local path to the OVF or OVA package for which the user-configurable options are returned. URL paths are not supported.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null 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.

Output

VMware.VimAutomation.ViCore.Types.V1.Ovf.OvfConfiguration

Examples

Example 1

$datastore = Get-Datastore -Name 'MyDatastore'
$ovfPath = "myOvfTemplate.ovf"

$ovfConfig = Get-OvfConfiguration -Ovf $ovfPath
$ovfConfig.NetworkMapping.VM_Network.Value = 'VM Network'

Import-VApp -Name 'myVApp' -Source $ovfPath -OvfConfiguration $ovfConfig -VMHost $vmHost -Datastore $datastore

Modifies a specific OVF property and passes it to the Import-VApp cmdlet.

Example 2

$datastore = Get-Datastore -Name 'MyDatastore'
$contentLibraryItem = Get-ContentLibraryItem -Name 'MyContentLibraryItem'
$target = Get-VMHost -Name 'MyVMHost'

$ovfConfig = Get-OvfConfiguration -ContentLibraryItem $contentLibraryItem -Target $target
$ovfConfig.EULAs.Accept.Value = $true
$ovfConfig.Common.vamitimezone.Value = 'US/Pacific'

New-VM -Name 'myVM' -ContentLibraryItem $contentLibraryItem -OvfConfiguration $ovfConfig -VMHost $target -Datastore $datastore

Specifies a content library item, sets the OVF parameters, and deploys a new virtual machine from specified content library item.

Related Commands

OvfConfiguration

This cmdlet retrieves the OVF configuration object from the specified OVF, OVA, or content library item.