< Back
Get-AzureRmTag
Post
NAME Get-AzureRmTag
SYNOPSIS
Gets predefined Azure tags.
SYNTAX
Get-AzureRmTag [[-Name] <String>] [-DefaultProfile <IAzureContextContainer>] [-Detailed] [<CommonParameters>]
DESCRIPTION
The Get-AzureRmTag 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.
The Azure Tags module that Get-AzureRMTag is a part of can 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-AzureRmTag cmdlet. To apply a predefined tag to a resource group, use the Tag parameter of the
New-AzureRmTag cmdlet. To search resource groups for a specific tag name or name and value, use the Tag parameter of the Get-AzureRMResourceGroup
cmdlet.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Detailed [<SwitchParameter>]
Indicates that this operation adds information about tag values to the output.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of the tag to get. By default, Get-AzureRmTag gets basic information about all predefined tags in the subscription. When
you specify the Name parameter, the Detailed parameter has no effect.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
Microsoft.Azure.Commands.Tags.Model.PSTag, Microsoft.Azure.Commands.Tags
NOTES
Example 1: Get all predefined tags
PS C:\\>Get-AzureRmTag
Name Count
======== =====
Department 5
FY2015 2
CostCenter 20
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.
Example 2: Get a tag by name
PS C:\\>Get-AzureRmTag -Name "Department"
Name: Department
Count: 5
Values:
Name Count
========== =====
Finance 2
IT 3
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.
Example 3: Get values of all tags
PS C:\\>Get-AzureRmTag -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
This command uses the Detailed parameter to get detailed information about all predefined tags in the subscription. Using the Detailed parameter
is the equivalent of using the Name parameter for every tag.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... azurermtag
New-AzureRmTag
Remove-AzureRmTag
SYNOPSIS
Gets predefined Azure tags.
SYNTAX
Get-AzureRmTag [[-Name] <String>] [-DefaultProfile <IAzureContextContainer>] [-Detailed] [<CommonParameters>]
DESCRIPTION
The Get-AzureRmTag 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.
The Azure Tags module that Get-AzureRMTag is a part of can 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-AzureRmTag cmdlet. To apply a predefined tag to a resource group, use the Tag parameter of the
New-AzureRmTag cmdlet. To search resource groups for a specific tag name or name and value, use the Tag parameter of the Get-AzureRMResourceGroup
cmdlet.
PARAMETERS
-DefaultProfile <IAzureContextContainer>
The credentials, account, tenant, and subscription used for communication with azure.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Detailed [<SwitchParameter>]
Indicates that this operation adds information about tag values to the output.
Required? false
Position? named
Default value False
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
-Name <String>
Specifies the name of the tag to get. By default, Get-AzureRmTag gets basic information about all predefined tags in the subscription. When
you specify the Name parameter, the Detailed parameter has no effect.
Required? false
Position? 0
Default value None
Accept pipeline input? True (ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
Microsoft.Azure.Commands.Tags.Model.PSTag, Microsoft.Azure.Commands.Tags
NOTES
Example 1: Get all predefined tags
PS C:\\>Get-AzureRmTag
Name Count
======== =====
Department 5
FY2015 2
CostCenter 20
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.
Example 2: Get a tag by name
PS C:\\>Get-AzureRmTag -Name "Department"
Name: Department
Count: 5
Values:
Name Count
========== =====
Finance 2
IT 3
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.
Example 3: Get values of all tags
PS C:\\>Get-AzureRmTag -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
This command uses the Detailed parameter to get detailed information about all predefined tags in the subscription. Using the Detailed parameter
is the equivalent of using the Name parameter for every tag.
RELATED LINKS
Online Version: https://docs.microsoft.com/en-us/powers ... azurermtag
New-AzureRmTag
Remove-AzureRmTag