title: How to get the NIC details for Application Security Group / Resource Group
body: <p>I'm looking a PowerShell command which is used to list out the relationship between the network interface card and its associated application security group / resources group.  I use the following commands and it only displays the VMName, IPAddress.  The Application Security Group cannot be shown up.</p>
  
  <p>I already use -ExpandProperty ApplicationSecurityGroups but still doesn't work.</p>
  
  <pre><code>$nics =Get-AzureRmNetworkInterface -ResourceGroupName "My-RG" 
  
  foreach($nic in $nics)
  {
      $vm = $vms | where-object -Property Id -EQ $nic.VirtualMachine.id
      $Name = $nic.Name
      $prv =  $nic.IpConfigurations | select-object -ExpandProperty PrivateIpAddress
      $alloc =  $nic.IpConfigurations | select-object -ExpandProperty PrivateIpAllocationMethod
      $asc =  $nic.IpConfigurations | select-object -ExpandProperty ApplicationSecurityGroups
      Write-Output "$Name, $prv , $asc"
  }
  </code></pre>