VMware Cloud Community
talvezu
Contributor
Contributor

New-VM with ContentLibraryItem ( without pipeline )

How do you implement New-VM from content library template without pipeline?

I am tring to find the equivalent without pipeline to the following command.
Get-ContentLibraryItemName MyVMContentLibrayItemName | New-VMName MyVM –VMHost $myVMHost

Get-ContentLibraryItem
  returns type

VMware.VimAutomation.ViCore.Impl.V1.ContentLibrary.ContentLibraryItemImpl

and there is no parameter which takes it in Get-VM,
according to

New-VM - vSphere PowerCLI Cmdlets Reference

My first guess was the -Template but the type is

VMware.VimAutomation.ViCore.Types.V1.Inventory.Template"

any suggestions?
regards,
Nir.

0 Kudos
0 Replies