PowerCLI Reference

New-TagCategory

Synopsis

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

Syntax

New-TagCategory [-Name] <String> [-Description <String>] [-Cardinality <Cardinality>] [-EntityType <String[]>] [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-TagCategory
Remove-TagCategory
Set-TagCategory

Detailed Description

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

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameStringSpecifies the name of the new tag category.truefalse
CardinalityCardinalitySpecifies 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.
falsefalse
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
DescriptionStringSpecifies the description of the new tag category.falsefalse
EntityTypeString[]Defines the type of objects to which the tags in this category will be applicable.
If you do not specify this parameter or specify "All" as a value, the tags in this category will be applicable to all valid 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 vSphere API type names that are not vCenter Server API type names, a namespace prefix is used.
The format is: <namespace>/<type>
Example: 'vco/WorkflowItem'
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.falsetrue (ByValue)
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

The newly created TagCategory object

Notes

Works only with vCenter Server 5.1 or later.

Examples

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

New-TagCategory -Name "MyTagCategory" -Cardinality "Single" -EntityType "VirtualMachine"

Creates a new tag category, named "MyTagCategory", defining the "VirtualMachine" type as applicable to the tags inside that category and specifying that only a single tag from that category can be assigned to a specific VirtualMachine object at a time.

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

New-TagCategory -Name "MyTagCategory" -Cardinality "Multiple" -Description "MyTagCategory description"

Creates a new tag category, named "MyTagCategory", that has "MyTagCategory description" set as a description and specifies that multiple tags from that category can be assigned to an object. Tags from this category are applicable to all valid entity types.


Copyright © VMware, Inc. All rights reserved.