Skip to content

Commit

Permalink
output improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Simone Zuppone committed Jul 2, 2020
1 parent 8b7e816 commit aa50756
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Pinger.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ $StartTime=Get-Date
Do {
Get-Date
$Exit = $False
$Results=@()
foreach ($AddrIP in $AddrIPs) {

$Pingo = Get-WmiObject Win32_PingStatus -f "Address='$AddrIP'"
$Pingo | Format-Table Address, ResponseTime, StatusCode -auto
$Results+=@([pscustomobject]@{Address=$Pingo.Address;ResponseTime=$Pingo.ResponseTime;StatusCode=$Pingo.StatusCode;TimeStamp=Get-Date})

}
$Results|Format-Table
Write-Host "Waiting for $Delay seconds..."
Write-Host "Next Ping cycle will start at "(Get-Date).AddSeconds($Delay)
Start-Sleep -seconds $Delay
if ($Seconds -ne 0){
$timeNow = Get-Date
Expand Down

0 comments on commit aa50756

Please sign in to comment.