locked
Can't search using get-azresourcegroup based on tag existing or not RRS feed

  • Question

  • I need to search on resource groups using Azure powershell cmdlets, but the examples given suggesting something like:

    Get-AzResourceGroup | where {$_.Tags.Count -gt 0 -and $_.Tags.Name -contains "AutoShutdownSchedule"}

    but the above returns nothing, even though I've manually checked in the portal that the tag value is there. If I run the command without the Where clause it returns all resource groups, including the one with the desired tag value.

    Wednesday, September 9, 2020 1:56 PM

All replies

  • I've now found a workaround by using search-azgraph but want to know if my issue is a known bug,
    Wednesday, September 9, 2020 2:12 PM