Last active
October 10, 2018 14:14
-
-
Save aaronlake/d62c09694a5ffdcac301ea20bbbddb5f to your computer and use it in GitHub Desktop.
Azure: List untagged resources
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
Write-Host "List all resource where Tag value is not Set" | |
Write-Host "********************************************" | |
#Fetch all resource details | |
$resources = get-AzureRmResource | |
foreach ($resource in $resources) { | |
$tagcount = (get-AzureRmResource | where-object {$_.Name -match $resource.Name}).Tags.count | |
if ($tagcount -eq 0) { | |
Write-Host "Resource Name - " $resource.Name | |
Write-Host "Resource Type and RG Name : " $resource.resourcetype " & " $resource.resourcegroupname "`n" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment