码迷,mamicode.com
首页 > 其他好文 > 详细

loop_nslookup

时间:2016-10-08 19:15:46      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:

 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 }

 

loop_nslookup

标签:

原文地址:http://www.cnblogs.com/cnblogist/p/5939341.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!