Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How can i export the results for this loop

$
0
0

Hi all 

i wrote a script to do nslookup for a list of web sites here is the code i wrote 

$servers = get-content "C:\NSLOOKUP.txt"
foreach ($server in $servers)  {
  $addresses = [System.Net.Dns]::GetHostAddresses($server)
  foreach($a in $addresses) {"{0},{1}" -f $server, $a.IPAddressToString
  }
} | Export-Csv 'C:\scripts\output.csv' -NoType

but it didn't export shall you support me on this 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>