Detecting and Removing Invalid vApps

After you run vCloud for a while, heck run any management product for a while, and you will have left overs, hung items, or even corrupt vApps.

With vCloud Director you can run the below to find those items and remove them.

1$badvapp = Search-Cloud -QueryType AdminVapp | Where-Object { $_.Status -eq "UNRESOLVED" }
2foreach ( $id in $badvapp ) {
3  Get-CIVApp -Id $id.id | Remove-CIVApp
4}

This probably wont remove everything, those items that are left, generally can only be removed via editing the database though, I would not recommend that.


Detecting and Removing Invalid vApp Templates
Remove vApp Template With No Catalog Item Link