Last active
January 27, 2022 17:58
-
-
Save vukasinterzic/6b534f9adf42f4ae980e71d427d8c794 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VMs = @('VM1', 'VM2', 'VM3', 'VM4') | |
$Tag = @{VMPasswordReset = "Yes"} | |
foreach ($VMName in $VMs) { | |
$VM = Get-AzResource -ResourceType "Microsoft.Compute/VirtualMachines" -Name $VMName | |
Update-AzTag -ResourceId $VM.ResourceId -Tag $Tag -Operation Merge | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment