Quantcast
Channel: VMware Communities : Popular Discussions - vCloud Director PowerCLI
Viewing all articles
Browse latest Browse all 13334

Adding a vApp to Catalog in vCD with PowerCLI

$
0
0

I would like add a vApp to a Catalog via PowerCLI. I can't see any methods under the extensiondata of the vApp that allow for this.

 

Then I thought maybe I need to look from the Catalog side and could only find CatalogItems in the GetCIView() of the org and don't know how to edit it:

 

$ciorg.ExtensionData.Catalogs.CatalogReference[0].GetCIView().CatalogItems

 

 

So then I tried scripting out the creation of a new catalog...It works but I still don't know to add vApps to it.

 

$ciorg = get-org "Org Name"

$cat = New-Object vmware.vimautomation.cloud.views.AdminCatalog
$cat.Owner = New-Object VMware.VimAutomation.Cloud.Views.Owner
$cat.Owner.User = New-Object VMware.VimAutomation.Cloud.Views.Reference
$cat.Owner.User = (get-org).ExtensionData.Users.UserReference[0]
$cat.CatalogItems = New-Object VMware.VimAutomation.Cloud.Views.CatalogItems
$cat.IsPublished = $True
$cat.Name = "Catalog Name"
$cat.Description = "Created with PowerCLI"
$ciorg.ExtensionData.CreateCatalog($cat)

 

*Entries in bold need refining. Didn't know how to search for a specific user so I used the first entry which is mine in the User array.

 

 

So currently I'm stumped. Alan, LucD or Jake...Ideas?

 

Thanks!


Viewing all articles
Browse latest Browse all 13334

Trending Articles