PowerCLI Reference

Get-Annotation

Synopsis

This cmdlet retrieves annotations.

Syntax

Get-Annotation [-Entity] <InventoryItem> [[-CustomAttribute] <CustomAttribute[]>] [-Server <VIServer[]>] [<CommonParameters>]

Get-Annotation [-Entity] <InventoryItem> [-Name <String[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online Version
Set-Annotation
Get-CustomAttribute
New-CustomAttribute
Remove-CustomAttribute
Set-CustomAttribute

Detailed Description

This cmdlet retrieves annotations. An annotation is a user-defined description field of one or more vSphere objects.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
EntityInventoryItemSpecifies the entities whose annotations you want to retrieve.trueTrue (ByValue)
CustomAttributeCustomAttribute[]Specifies the custom attributes whose annotations you want to retrieve.falseFalse
NameString[]Specifies the names of the annotations you want to retrieve.falseFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falseFalse

Return Type

Zero or more Annotation objects

Notes

Examples

-------------------------- Example 1 --------------------------

Get-Cluster Cluster | Get-Annotation -CustomAttribute PhysicalLocation

Retrieves the annotation of the PhysicalLocation custom attribute for Cluster.

-------------------------- Example 2 --------------------------

$vm = Get-VM -Name $vmname 
Get-Annotation -Entity $vm -CustomAttribute Description

Retrieves the annotation of the Description custom attribute for the $vm virtual machine.


Copyright © VMware, Inc. All rights reserved.