To install an OVF template with PowerCLI you can use Import-VApp. But before you do, you’ll need to update our OVF configuration for deployment.

First, start by creating a variable containing your OVF path:

$ovfpath = "C:\bin\LoadMaster-VLM-"

Using Get-OvfConfiguration, view the configurable properties:

$ovfconfig = Get-OvfConfiguration -Ovf $ovfpath
$ovfconfig.ToHashTable() | ft

Mine only had two properties:

Name                   Value
----                   -----

To set the values I ran:

$ovfconfig.NetworkMapping.Farm.Value = "DMZ"
$ovfconfig.NetworkMapping.Network.Value = "VM Network"

Before running Import-VApp I captured my host and datastore in variables:

$vmhost = get-vmhost labhost1.a1.local
$ds = Get-Datastore datastore1

And finally, using Import-VApp, deploy the OVF template:

Import-VApp -Source $ovfpath -OvfConfiguration $ovfconfig -Name KEMPLB -VMHost $vmhost -Datastore $ds -DiskStorageFormat Thin