title: Powershell hashtables values output Assembly not Value
body: <p>Hi I'm trying to get vnet peering property using a Powershell script.</p>
  <p>But I keep getting these values in teh table below, but when I print to screen they print fine.</p>
  <p>These are values I keep getting:
  RemoteVirtualNetwork
  Microsoft.Azure.Commands.Network.Models.PSResourceId</p>
  <p>RemoteVirtualNetworkAddressSpace
  Microsoft.Azure.Commands.Network.Models.PSAddressSpace</p>
  <p><a href="https://i.stack.imgur.com/F4m70.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F4m70.jpg" alt="Error" /></a></p>
  <pre><code>#Login-AzAccount
  $Subs = Get-AzSubscription
  
  foreach ( $Sub in $Subs ) {
      Set-AzContext -Subscription $Sub | Out-Null
      $SubName = $sub.name
  
        $vnets=get-azvirtualnetwork
  
        foreach ($azvnet in $vnets){
             $peer=get-AzVirtualNetworkPeering -VirtualNetworkName $azvnet.name -ResourceGroup $azvnet.ResourceGroupName | select-object ResourceGroupName,VirtualNetworkName,PeeringState,AllowVirtualNetworkAccess,AllowGatewayTransit,UseRemoteGateways,RemoteVirtualNetwork,RemoteVirtualNetworkAddressSpace
             
      
  
             ForEach-Object{
  
             New-Object PSObject -Property @{
             
                   ResourceGroupName = $peer.ResourceGroupName
                   VirtualNetworkName= $peer.VirtualNetworkName
                   PeeringState = $peer.PeeringState
                   PeeringSyncLevel = $peer.PeeringSyncLevel
                   AllowVirtualNetworkAccess = $peer.AllowVirtualNetworkAccess
                   AllowForwardedTraffic = $peer.AllowForwardedTraffic
                   AllowGatewayTransit = $peer.AllowGatewayTransit
                   UseRemoteGateways = $peer.UseRemoteGateways
                   RemoteVirtualNetwork = $peer.RemoteVirtualNetwork.Id.Split(&quot;/&quot;)[-1]  
                   RemoteGateways = $peer.RemoteGateways
                   PeeredRemoteAddressSpace = $peer.PeeredRemoteAddressSpace
                   RemoteVirtualNetworkAddressSpace = $peer.RemoteVirtualNetworkAddressSpace | Select-Object -ExpandProperty AddressPrefixes 
  
                 }
             }
  
             $peer|export-csv -path c:\personal\peers04.csv 
        }
  
  }
  </code></pre>