title: Power Shell test-connection and then get computers name or mac-addr
body: <p>So I have written a simple pinger that ping all that a network. I'm using test-connection, but I what to also get the devises name as well.</p>
  
  <p>So I'm using cmd's nbtstat to get the name but (lets say it's not clean)</p>
  
  <p>Is there a way to do this a bit cleaner?</p>
  
  <p>this is what i have got</p>
  
  <pre><code>$a = New-Object System.Collections.ArrayList
  
  for ($i =0;$i -le 225; $i++){
      if (Test-Connection 192.168.1.$i -Count 1 -Quiet){
          echo "live 192.168.1.$i"
          $a.add("192.168.1.$i")
      }else {
          echo "dead 192.168.1.$i"
      }
  }
  echo $a
  foreach ($i in $a){
      Test-Connection $i -Count 1
  
  }
  
  foreach ($i in $a){
      nbtstat -a $i
  }
  </code></pre>