Hello guys
Maybe you can help me with a problem. What I'm trying to do is that I can filter or delet a specific word from the output that is writte into $file. My results in the textfile "nslookup2" look like this:
Line
----
Name: server.domain.blabla.com
Name: server2.domain.blabla.com
Name: server3.domain.blabla.com
Now I don't want to have the word "Name: " in the output file. Can I somehow filter this word?
$path="C:\Users\xxxxx\Desktop\Backupclients3.txt"
$i= Get-Content $path
$ausgabe="C:\Users\xxxxx\Desktop\nslookup2.txt"
foreach ($names in $i)
{
$i=$names
nslookup $i 2>&1| select-string "Name|non-existent" -outvariable +file
}
$file | format-table -autosize -property line >>$ausgabe