Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This is a custom-developed cmdlet from This can be referenced as part of your Powershell profile, or just included at the top of your script.
Function Get-CIMetaData {
Retrieves all Metadata Key/Value pairs.
Retrieves all custom Metadata Key/Value pairs on a specified vCloud object
The object on which to retrieve the Metadata.
The key to retrieve.
PS C:\> Get-CIMetadata -CIObject (Get-Org Org1)
Process {
Foreach ($Object in $CIObject) {
If ($Key) {
($Object.ExtensionData.GetMetadata()).MetadataEntry | Where {$_.Key -eq $key } | Select @{N="CIObject";E={$Object.Name}}, Key, Value
} Else {
($Object.ExtensionData.GetMetadata()).MetadataEntry | Select @{N="CIObject";E={$Object.Name}}, Key, Value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment