Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. $servers = Get-Content server.list
  2. $count = 10
  3. $outfile = 'hoge.csv'
  4.  
  5. while($count){
  6. $time = {Get-Date}
  7. Test-Connection $servers -Count 1 -Delay 1 -AsJob |
  8. Wait-Job | Receive-Job |
  9. Select @{n="Time";e=$time},Address,ReplySize,ResponseTime,ResponseTimeToLive,StatusCode -OutVariable result | Out-Null
  10.  
  11. $result | Format-Table -AutoSize
  12. $result | Export-Csv -Append $outfile
  13.  
  14. Remove-Job -State Completed
  15.  
  16. $count -= 1
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement