How to update Tag for all VM in particular Resource Group

Small script to remember how to update Tag for all VM in particular resource group:

$tags = @{“tag01″=”value1”; “tag02″=”value2”; “tag03″=”value3”}

Get-AzResource -ResourceGroup todelete -resourcetype Microsoft.Compute/virtualMachines| Update-AzTag -Tag $tags -Operation Merge

PowerShell
VM
Tag

Comments

Leave a Comment

All fields are required. Your email address will not be published.