标签:
1 function loop_nslookup() { 2 $baseFolder = "D:\ps_toolkit" 3 $ip_list = "$baseFolder\ip_list.txt" 4 $cmd = "C:\Windows\System32\nslookup.exe" 5 $reader = [System.IO.File]::OpenText($ip_list) 6 $reader.GetType() 7 while($null -ne ($line = $reader.ReadLine())) { 8 $arg1 = $line.Trim() 9 if("".Equals($arg1) -or $arg1.StartsWith("#")){ 10 continue 11 } 12 & $cmd $arg1 13 #write-host "[$cmd] - [$arg1]" 14 write-host "=====" 15 } 16 $reader.Close() 17 }
标签:
原文地址:http://www.cnblogs.com/cnblogist/p/5939341.html