PowerCLI Reference

Set-Annotation

Synopsis

This cmdlet modifies the value of a custom attribute.

Syntax

Set-Annotation [-Entity] <InventoryItem[]> [-CustomAttribute] <CustomAttribute> [-Value] <String> [-Server <VIServer[]>] [-Confirm] [-WhatIf] [<CommonParameters>]

Related Commands

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

Detailed Description

This cmdlet modifies the value of a custom attribute that applies to one or more inventory items.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
EntityInventoryItem[]Specifies the entities to which the new annotation value applies.trueTrue (ByValue)
CustomAttributeCustomAttributeSpecifies the custom attribute whose annotation you want to change.trueTrue (ByValue)
ValueStringSpecifies a new value for the annotation.trueFalse
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falseFalse
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falseFalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falseFalse

Return Type

Zero or more modified Annotation objects

Notes

Examples

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

Set-Annotation -Entity $vmhost -CustomAttribute "PhysicalLocation" -Value Office

Modifies the annotation of the PhysicalLocation custom attribute for the host stored in the $vmhost variable.

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

Get-Cluster Cluster | Set-Annotation -CustomAttribute "PhysicalLocation" -Value California

Modifies the annotation of the PhysicalLocation custom attribute for the Cluster cluster.


Copyright © VMware, Inc. All rights reserved.