VMware Cloud Community
Maheshatty
Contributor
Contributor

Clone template to VDC folders in vcenter using power cli

Hey Everyone,

Brand new to PowerCLI and had a task I would like some help with

I need to clone a template from Content library to a virtual data center(VDC) folders in vcenter.

VDC folders in format ( /London/test_11/test_12")

Thanks for the help!

Labels (1)
0 Kudos
2 Replies
Macleud
Enthusiast
Enthusiast

Hello.
Tell me a little more.

Do you want to import a template into a Org catalog?
Or just put the template as a vm in a folder in vCenter?

0 Kudos
MerlevedeN
Enthusiast
Enthusiast

Maybe this can give you a start:

$myVMHost = Get-VMHost myVMHost
$myFolder = Get-Folder -Name "MyFolder1"
$myDs = Get-Datastore -Name "MyDatastore1"

Get-ContentLibraryItem –Name MyVMContentLibrayTempalteName | New-Template -Name "MyTemplate" -Datastore $myDs -Location $myFolder -VMHost $myVMHost
 
0 Kudos