New-AzTag

In this Azure article, we will discuss the syntax and the usage of the New-AzTag PowerShell command with a few examples of how to use this command.

New-AzTag

New-AzTag is a very good PowerShell command that can help you quickly create a predefined Azure tag.

Syntax

Below is the Syntax of the New-AzTag PowerShell command.

New-AzTag
 [-Name] <String>
New-AzTag
 [-ResourceId] <String>

Examples

Let’s discuss a few examples of how to use the New-AzTag PowerShell command.

Example-1

You can execute the below PowerShell command with a specified name.

New-AzTag -Name "ALessons"

After executing the above command, the tag named “ALessons” was created successfully. I got the below output.

PS C:\windows\system32> New-AzTag -Name "ALessons"

Name     ValuesTable Count Values
----     ----------- ----- ------
ALessons             0     {}    

You can see the same output here as below

New-AzTag

Example-2

You can execute the below PowerShell command to create a predefined Azure tag with a specified value.

New-AzTag -Name "Emp" -Value "info"

After executing the above PowerShell command, I got the below-expected output.

PS C:\windows\system32> New-AzTag -Name "Emp" -Value "info"

Name ValuesTable                               Count Values
---- -----------                               ----- ------
Emp  ...                                       0     {info}

Check out the same output as below

New-AzTag PowerShell

Conclusion

In this Azure PowerShell article, we discussed the syntax and usage of the New-AzTag PowerShell command along with certain examples of how to use this command. Thanks for reading this article !!!