Can't find tagged Azure resource group with powershell
<p>I have tagged my azure resource groups based on environments. </p>

<p>Now I'am trying to do some automation on the test environments and I want to retrieve all resource groups tagged with Env=test. </p>

<p>I found this line here (<a href="https://azure.microsoft.com/nb-no/documentation/articles/resource-group-using-tags/" rel="nofollow">https://azure.microsoft.com/nb-no/documentation/articles/resource-group-using-tags/</a>)</p>

<pre><code>   $testRg= Find-AzureRmResourceGroup -Tag @{ Name="Env"; Value="Test" } | %{ $_.Name }
</code></pre>

<p>The problem is that this doesn't return anything.</p>

<p>Then i tried to tag a single resource with the same tag and that worked with this line:</p>

<pre><code>$testR= Find-AzureRmResource -TagName Env -TagValue Test| %{ $_.ResourceName }
</code></pre>

<p>Anyone experienced this or know what I'am doing wrong?</p>