title: Getting IP address while using Test-Connection
body: <p>I am trying to add the IP address to this script, it would be perfect if I could get this to work. Any help is greatly appreciated.
  The input files has host names, and I like to get the IP address into the csv please.</p>
  
  <pre><code>$servers = Get-content "servers.txt"
  $collection = $()
  foreach ($server in $servers)
  {
      $status = @{ "ServerName" = $server; "TimeStamp" = (Get-Date -f s);"IP" = what to put here? }
      if (Test-Connection $server -Count 1 -ea 0 -Quiet)
      { 
          $status["Results"] = "Up"
      } 
      else 
      { 
          $status["Results"] = "Down" 
      }
      New-Object -TypeName PSObject -Property $status -OutVariable serverStatus
      $collection += $serverStatus
  
  }
  $collection | Export-Csv -LiteralPath .\ServerStatus.csv -NoTypeInformation
  </code></pre>