## PowerCLI Reference

# Get-Tag

## Synopsis

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

Syntax

Get-Tag [[-Name] <String[]>] [-Category <TagCategory[]>] [-Server <VIServer[]>] [<CommonParameters>]
Get-Tag -Id <String[]> [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
New-Tag
Remove-Tag
Set-Tag

Detailed Description

This cmdlet retrieves the tags available on a vCenter Server system. This cmdlet filters tags by name and category to which tags belong.

Parameters

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
Name | String[] | Filters the tags by name. | false | false
Category | TagCategory[] | Filters the tags by category. | false | true (ByValue)
Id | String[] | Filters the tags by ID. Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list. | true | false
Server | VIServer[] | 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. | false | false

Return Type

Zero or more Tag objects

Notes

Works only with vCenter Server 5.1 or later.

Examples

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

    Get-Tag -Name "MyTag"

Returns all tags named "MyTag".

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

    Get-Tag -Category "MyCategory1", "MyCategory2" -Name "MyTag"

Returns all tags from the "MyCategory1" and "MyCategory2" categories, named "MyTag".

Copyright © VMware, Inc. All rights reserved.