New-CustomAttribute Command | Vmware PowerCLI Reference

New-CustomAttribute

This cmdlet creates a new custom attribute. A custom attribute is a user-defined description field of one or more vCenter Server objects.

Syntax

New-CustomAttribute
-Name < String >
[ [-TargetType ] < CustomAttributeTargetType[] > ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Name String named
Specifies a name for the new custom attribute.
optional TargetType CustomAttributeTargetType[] 1
Specifies the type of the objects to which the new custom attribute applies. The valid values are VirtualMachine, ResourcePool, Folder, VMHost, Cluster, Datacenter, and $null. If the value is $null the custom attribute is global and applies to all target types.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null 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.

Output

VMware.VimAutomation.ViCore.Types.V1.AnnotationManagement.CustomAttribute

Examples

Example 1

New-CustomAttribute -Name "CompanyName" -TargetType VMHost, VirtualMachine

Creates a new custom attribute named CompanyName for the virtual machines and hosts on the server.

Related Commands

CustomAttribute

This cmdlet retrieves custom attributes.

This cmdlet creates a new custom attribute.

This cmdlet removes custom attributes.

This cmdlet renames a custom attribute.