Skip to content

Instantly share code, notes, and snippets.

@aaronlake
Last active October 10, 2018 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronlake/d62c09694a5ffdcac301ea20bbbddb5f to your computer and use it in GitHub Desktop.
Save aaronlake/d62c09694a5ffdcac301ea20bbbddb5f to your computer and use it in GitHub Desktop.
Azure: List untagged resources
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