title: How to see app insights of a particular subscription through powershell?
body: <p>I want to get app insights of all the subscriptions available in the portal but whenever I run the script</p>
  <pre><code>$resources =  az monitor  app-insights component show | ConvertFrom-Json
  </code></pre>
  <p>I get app insights only for the same subscription every time , even during the time when I change the subscription through the script</p>
  <pre><code>Set-AzContext -SubscriptionName &quot;some-name&quot;
  </code></pre>
  <p>the whole script goes like this</p>
  <pre><code>Set-AzContext -SubscriptionName &quot;some-name&quot;
  $resources =  az monitor  app-insights component show | ConvertFrom-Json
  </code></pre>
  <p>So even if I change the subscription name to something else suppose &quot;some-name1&quot;
  still I am getting the app-insights for subscription &quot;some-name&quot;</p>