Get-TagAssignment

This cmdlet retrieves the tag assignments of objects. If the Entity parameter is specified, the cmdlet returns only the tag assignments for the corresponding items. If the Category parameter is specified, the cmdlet returns only the tag assignments of tags that belong to the specified category.

Syntax

[-Category  <TagCategory[]>]
[-Entity  <VIObjectCore[]>]
[-Server  <VIServer[]>]
[-Tag  <Tag[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
Category
TagCategory[] named
  • wildcards
  • Returns the tags that belong to the specified categories.
    optional
    Entity
    VIObjectCore[] named
  • wildcards
  • pipeline
  • Retrieves the tags associated with the specified items.
    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.
    optional
    Tag
    Tag[] named
  • wildcards
  • Returns the tag assignments that belong to the specified tags.

    Output

    VMware.VimAutomation.ViCore.Types.V1.Tagging.TagAssignment

    Examples


    Example 1

    Get-TagAssignment

    Retrieves all tag assignments for the current vCenter Server instances.

    Example 2

    $datastore = Get-DataStore MyDatastore
    Get-TagAssignment -Entity $datastore -Category MyCategory

    Retrieves all tag assignments for the $datastore entity that have tags from the "MyCategory" category.

    Example 3

    Get-TagAssignment -Tag MyTag

    Retrieves all assignments of the specified tag.

    Related Commands

    Feedback

    Was this page helpful?