Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Get-AzureTag

Get-AzureTag

microsoft.azure.commands.tags.dll

Synopsis

Gets predefined Azure tags

Syntax

Get-AzureTag [-Name] [-Detailed] [<CommonParameters>]

Detailed Description

The Get-AzureTag cmdlet gets predefined Azure tags in your subscription. This cmdlet returns basic information about the tags or detailed information about tags and their values. All output objects include a Count property that represents the number of resources and resource groups to which the tags and values have been applied. Get-AzureTag is part of a set of cmdlets (New/Get/Remove) that help you manage predefined Azure tags.An Azure "tag" is a name-value pair that you can use to categorize your Azure resources and resource groups, such as by department or cost center, or to track notes or comments about the resources and groups. You can define and apply tags in a single step, but predefined tags let you establish standard, consistent, predictable names and values for the tags in your subscription. If the subscription includes any predefined tags, you cannot apply undefined tags or values to any resource or resource group in the subscription.To create a predefined tag, use the New-AzureTag cmdlet. To apply a predefined tag to a resource or resource group. use the Tag parameters of the New and Set cmdlets in the AzureResourceManager module. To search for resources or resource groups with a specified tag name or name and value, use the Tag parameters of the Get-AzureResource and Get-AzureResourceGroup cmdlets.

Parameters

-Name <String>

Gets detailed information about the predefined tag with the specified name. By default, Get-AzureTag gets basic information about all predefined tags in the subscription.When you use the Name parameter, the Detailed parameter has no effect.

Aliases

None

Required?

false

Position

0

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

-Detailed <SwitchParameter>

Adds information about tag values to the output.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

true (ByPropertyName)

Accept wildcard characters?

false

Input Type

None

Return Type

Microsoft.Azure.Commands.Tags.Model.PSTag, Microsoft.Azure.Commands.Tags

Notes

Examples

-------------------------- Example 1: Get all predefined tags --------------------------

This command gets all predefined tags in the subscription. The Count property shows how many times the tag has been applied to resources and resource groups in the subscription.

PS C:\>Get-AzureTag
Name      Count

========  =====

Department    5

FY2015        2

CostCenter   20

-------------------------- Example 2: Get a tag by name --------------------------

This command gets detailed information about the Department tag and its values. The Count property shows how many times the tag and each of its values has been applied to resources and resource groups in the subscription.

PS C:\>Get-AzureTag -Name Department
Name:   Department

Count:  5

Values: 

        Name        Count

        ==========  =====

        Finance       2

        IT            3

-------------------------- Example 3: Get values of all tags --------------------------

This command uses the Detailed parameter to get detailed information about all predefined tags in the subscription. It's the equivalent of using the Name parameter for every tag.

PS C:\>Get-AzureTag -Detailed
Name:   Department

Count:  5

Values: 

        Name        Count

        ==========  =====

        Finance       2

        IT            3


Name:   FY2015

Count:  2


Name:   CostCenter

Count:  20

Values: 

        Name        Count

        ==========  =====

        0001          5

        0002         10

        0003          5

Online Version
New-AzureTag
Remove-AzureTag