title: Get current IP addresses associated with an Azure ARM VM's set of NICs via Powershell
body: <p>I'm trying to write some Powershell to get a list of Azure ARM vms (Not classic) and the currently associated IP addresses for their NICs.</p>
  
  <p>In classic, this was part of the VM object, but in ARM it's a seperate object, and I'm struggling to get the Powershell to work in the way I want.</p>
  
  <p>I've got the following code segment:</p>
  
  <pre><code>$nic = (((Get-AzureRmVM).NetworkProfile).NetworkInterfaces).Id
  ForEach ($i in $nic) {
    $nicname = $i.substring($i.LastIndexOf("/")+1)
    Get-AzureRmNetworkInterface -Name $nicname -ResourceGroupName RGTEST | Get-AzureRmNetworkInterfaceIpConfig | select-object  PrivateIpAddress,PrivateIpAllocationMethod
  }
  </code></pre>
  
  <p>Which works, but only for VMs in the specified resource group 'RGTEST'.</p>
  
  <p>It seems that Get-AzureRmNetworkInterface can only work when passed in the NIC Name and the ResourceGroupName, but I can't seem to get the RGname from the VM to be passed in.</p>
  
  <p>Probably really easy, but I'm struggling with it!</p>