< Back

Get-Tag

Sun Jan 19, 2020 6:52 pm

NAME 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>]





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

-Category <TagCategory[]>

Filters the tags by category.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-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.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String[]>

Filters the tags by name.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more Tag objects







NOTES





Works only with vCenter Server 5.1 or later.



-------------------------- 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".



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... t-Tag.html

New-Tag

Remove-Tag

Set-Tag