Set-TagCategory Command | Vmware PowerCLI Reference

Set-TagCategory

This cmdlet modifies the specified tag categories. The cardinality of a tag category can only be changed from "Single" to "Multiple".

Syntax

Set-TagCategory
-Category < TagCategory[] >
[-AddEntityType < String[] > ]
[-Cardinality < Cardinality > ]
[-Description < String > ]
[-Name < String > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Category TagCategory[] named
  • pipeline
  • wildcards
Specifies the tag categories that you want to configure.
optional AddEntityType String[] named
Adds the specified entity types to the list of types that tags in this category are applicable to. If you specify "All" as a value, the tags will be applicable to all entity types. This parameter accepts both PowerCLI type names and vSphere API type names. The valid PowerCLI type names are: Cluster, Datacenter, Datastore, DatastoreCluster, DistributedPortGroup, DistributedSwitch, Folder, ResourcePool, VApp, VirtualPortGroup, VirtualMachine, VM, VMHost. For non-PowerCLI types, a namespace prefix is required. Example: 'urn:vim25:VirtualMachine'
optional Cardinality Cardinality named
Specifies the cardinality of the tag category. If not specified, the default value is "Single". "Single" means that only a single tag from this category can be assigned to a specific object at a time. "Multiple" means that more than one tag from this category can be assigned to a specific object at a time. The only value that is accepted for this parameter is "Multiple".
optional Description String named
Specifies the new description to set to the tag categories.
optional Name String named
Specifies the name to which the specified tag categories will be renamed.
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.Tagging.TagCategory

Examples

Example 1

Get-TagCategory "MyTagCategory" | Set-TagCategory -Name "MyNewCategoryName" -Description "Update MyTagCategory description"

Retrieves a tag category named "MyTagCategory" and updates its name and description.

Example 2

$myTagCategory = Get-TagCategory "MyTagCategory"
Set-TagCategory -Category $myTagCategory -Cardinality Multiple -AddEntityType "VirtualMachine"

Retrieves a tag category named "MyTagCategory" and updates it by allowing more than one of its tags to be assigned to a specific object at a time, as well as adding "VirtualMachine" to the set of applicable entity types.

Related Commands

Tag

This cmdlet retrieves the tags available on a vCenter Server system.

This cmdlet creates a new tag in the specified tag category with the specified parameters.

This cmdlet removes the specified tags from the server.

This cmdlet modifies the specified tags.

TagAssignment

This cmdlet retrieves the tag assignments of objects.

This cmdlet assigns the specified tag(s) to the specified entity(s).

This cmdlet removes the specified tag assignment.

TagCategory

This cmdlet retrieves the tag categories available on a vCenter Server system and filters them using the specified cmdlet parameters.

This cmdlet creates a new tag category on the specified vCenter Server systems with the specified parameters.

This cmdlet removes the specified tag categories from the server.

This cmdlet modifies the specified tag categories.