title: pulling computer names from a network by IP address using a CSV file
body: <p>I have been trying to figure out for a few days now why my code is not working.<br>
  pretty much I have a list of IP addresses in a CSV file. from this list of IP addresses I want to obtain the computer name.  When I execute no matter what I get </p>
  
  <p>Exception calling "GetHostByAddress" with "1" argument(s): "An invalid IP address was specified."
  At line:3 char:35
  + [System.Net.dns]::GetHostbyAddress &lt;&lt;&lt;&lt; ("$foo[0]")
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : DotNetMethodException</p>
  
  <p>Here is an example of the CSV File and the code used:</p>
  
  <p>CSV File</p>
  
  <p>Value <br />
  192.168.0.11 <br />
  192.168.0.12 <br />
  192.168.0.13 <br />
  192.168.0.14 <br /></p>
  
  <p>The code being used:</p>
  
  <pre><code>$foo = import-csv  C:\test\test\test.csv 
  [System.Net.dns]::GetHostbyAddress("$foo[0]")
  </code></pre>