1- <#
2- #>
3-
4- param ()
1+ param ()
52
63function Show-Header {
74 Clear-Host
85 Write-Host " ===============================" - ForegroundColor Cyan
9- Write-Host " WinNetPulse v1.2.1 " - ForegroundColor Green
6+ Write-Host " WinNetPulse v1.3 " - ForegroundColor Green
107 Write-Host " ===============================" - ForegroundColor Cyan
118}
129
@@ -59,6 +56,10 @@ function Write-ColoredLatency($time, $text) {
5956 }
6057}
6158
59+ function Get-TimeStamp {
60+ return (Get-Date ).ToString(" yyyy/MM/dd HH:mm:ss.ff" )
61+ }
62+
6263function Invoke-PingTest ($target , $count ) {
6364
6465 $min = [int ]::MaxValue
@@ -81,6 +82,7 @@ function Invoke-PingTest($target, $count) {
8182 $sent ++
8283
8384 $reply = Test-Connection - ComputerName $target - Count 1 - ErrorAction SilentlyContinue
85+ $ts = Get-TimeStamp
8486
8587 if ($reply ) {
8688
@@ -93,13 +95,13 @@ function Invoke-PingTest($target, $count) {
9395
9496 $sum += $time
9597
96- $text = " [$sent ] ${time} ms TTL=$ttl "
98+ $text = " [$sent ] ${time} ms TTL=$ttl [ $ts ] "
9799
98100 Write-ColoredLatency $time $text
99101 }
100102 else {
101103
102- Write-Host " [$sent ] Request timed out." - ForegroundColor Red
104+ Write-Host " [$sent ] Request timed out. [ $ts ] " - ForegroundColor Red
103105 }
104106
105107 Start-Sleep - Seconds 1
@@ -112,6 +114,7 @@ function Invoke-PingTest($target, $count) {
112114 $sent ++
113115
114116 $reply = Test-Connection - ComputerName $target - Count 1 - ErrorAction SilentlyContinue
117+ $ts = Get-TimeStamp
115118
116119 if ($reply ) {
117120
@@ -124,13 +127,13 @@ function Invoke-PingTest($target, $count) {
124127
125128 $sum += $time
126129
127- $text = " [$i /$count ] ${time} ms TTL=$ttl "
130+ $text = " [$i /$count ] ${time} ms TTL=$ttl [ $ts ] "
128131
129132 Write-ColoredLatency $time $text
130133 }
131134 else {
132135
133- Write-Host " [$i /$count ] Request timed out." - ForegroundColor Red
136+ Write-Host " [$i /$count ] Request timed out. [ $ts ] " - ForegroundColor Red
134137 }
135138
136139 Start-Sleep - Seconds 1
@@ -178,7 +181,7 @@ function Run-PingMode {
178181
179182 $result = Invoke-PingTest $target $count
180183
181- Write-Host " `n ===== WinNetPulse Summary =====" - ForegroundColor Cyan
184+ Write-Host " `n ===== NetPulse Summary =====" - ForegroundColor Cyan
182185
183186 Write-Host " Target: $ ( $result.Target ) "
184187
0 commit comments