title: Why ForEach-Object doesn't work for AzureRM cmdlet
body: <p>I am trying to execute a very simple cmdlet but it doesn't work </p>
  
  <pre><code>$resources = Get-AzureRMResourceGroup | % { Get-AzureRMResource -ResourceGroupName $_.ResourceGroupName}
  
  $resources
  </code></pre>
  
  <p>The error message being thrown is as follows</p>
  
  <blockquote>
    <p>Get-AzureRmResource : Parameter set cannot be resolved using the<br>
    specified  named parameters. At line:1 char:45<br>
    + ... Group | % { Get-AzureRMResource -ResourceGroupName $_.ResourceGroupNa ...<br>
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
        + CategoryInfo          : InvalidArgument: (:) [Get-AzureRmResource], Para     meterBindingException<br>
        + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.R<br>
    esourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet</p>
  </blockquote>