VMware Cloud Community
barnette08
Expert
Expert

Remove Catalog?

Does anyone know of a remove catalog command?  I know there is a Get-Catalog cmdlet, but I don't see anything to remove one.

Thanks. -DB

Reply
0 Kudos
3 Replies
CSIEnvironments
Enthusiast
Enthusiast

You can use the ExtensionData property.

(get-catalog "test").ExtensionData.Delete()

or

$cat = get-catalog "test"

$cat.ExtensionData.Delete()

Reply
0 Kudos
barnette08
Expert
Expert

that worked, thanks a bunch!  I still need to find something about removing media as well, but I bet I can do it with the ExtensionData property.  Where can I find more information on ExtensionData and its purpose?  Thanks again. -DB

Reply
0 Kudos
CSIEnvironments
Enthusiast
Enthusiast

Guessing as I've never tried it but this should in theory work: (get-media "test").ExtensionData.Delete()

The extension data is available for all objects. For example to get everything you can do to a CIvApp you can look at the following:

$civapp = get-civapp "Test"

$civapp.ExtensionData | gm

If you look at that you can see all the methods available:

$civapp.ExtensionData.PowerOn

$civapp.ExtensionData.Deploy

etc...

If you unsure of what parameters are required you can use the | fl on the method. Then look at the OverloadDefinitions for what is required:

eg:  $civapp.ExtensionData.Deploy | fl

OverloadDefinitions : {System.Void Deploy(System.Nullable[bool] powerOn, System.Nullable[bool] forceCustomization, System.Nullable[int] deploymentLeaseSeconds)}

You will see what you need to pass it:

$civapp.ExtensionData.Deploy($false,$false,0)

Cheers!

Reply
0 Kudos