foreach ( $azVM in Get-AzVM ) {
#$azVm
$networkProfile = $azVm.NetworkProfile.NetworkInterfaces.id.Split("/")|Select -Last 1
$IPConfig = (Get-AzNetworkInterface -Name $networkProfile).IpConfigurations.PrivateIpAddress
[pscustomobject]@{
fqdn = $azVm.OsProfile.ComputerName
ipaddress = $IPConfig
}