SyntaxFix
Write A Post
Hire A Developer
Questions
Try this
$servers = Get-Content test.txt $reg="" foreach ($server in $servers) { $reg=$reg+$server+"`t"+([System.Net.Dns]::GetHostAddresses($server) | foreach {echo $_.IPAddressToString})+"`n" } $reg >reg.csv