Using PowerShell to get Awk like results

In this example we want to convert dns or computer names to a single ip and write that single ip to a file so we can import that file into a scanner like nessus or nexpose.  Typically this would be a job for awk however, now that windows 7 comes with powershell we can utilize that to simulate awk.  
Put your computer names into the file named computernames.txt.  Next create a bat file with the following code in there.

for /f %%i in (computernames.txt) do @ping %%i | @find "Pinging" >> output1.txt
powershell -Command "Get-Content .\output1.txt | %%{ $_.Split('')[2];} | %%{ $_.Split('[]')[1];} > 'output.txt'"
Next just run the bat file from the command line.