Pinging xxxxxxxxxxx [::1] with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Ping statistics for ::1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
ditto to what Olaf and js is stating. doing the following in the consolehost/ISE/VSCode all return the same results.
($t = D:\Tools\psping -accepteula localhost)
([string]$t = D:\Tools\psping -accepteula localhost)
PsPing v2.10 - PsPing - ping, latency, bandwidth measurement utility
Copyright (C) 2012-2016 Mark Russinovich
Sysinternals - www.sysinternals.com
Pinging ::1 with 32 bytes of data:
5 iterations (warmup 1) ping test:
Reply from ::1: 0.83ms
Reply from ::1: 0.54ms
Reply from ::1: 1.26ms
Reply from ::1: 0.60ms
Reply from ::1: 1.27ms
Ping statistics for ::1:
Sent = 4, Received = 4, Lost = 0 (0% loss),
Minimum = 0.54ms, Maximum = 1.27ms, Average = 0.92ms
PsPing v2.10 - PsPing - ping, latency, bandwidth measurement utility Copyright (C) 2012-2016 Mark Russinovich Sysinternals - www.sysinternals.com Pinging ::1 with 32 bytes of data: 5 iterations (warmup 1) ping test: Reply from ::1: 1.04ms Reply from ::1: 0.63ms Reply from ::1: 0.69ms Reply from ::1:
1.15ms Reply from ::1: 1.25ms Ping statistics for ::1: Sent = 4, Received = 4, Lost = 0 (0% loss), Minimum = 0.63ms, Maximum = 1.25ms, Average = 0.93ms
($g = D:\Tools\psping -accepteula localhost)
([string]$g = D:\Tools\psping -accepteula localhost)
PsPing v2.10 - PsPing - ping, latency, bandwidth measurement utility
Copyright (C) 2012-2016 Mark Russinovich
Sysinternals - www.sysinternals.com
Pinging ::1 with 32 bytes of data:
5 iterations (warmup 1) ping test:
Reply from ::1: 0.74ms
Reply from ::1: 1.04ms
Reply from ::1: 1.06ms
Reply from ::1: 0.94ms
Reply from ::1: 1.08ms
Ping statistics for ::1:
Sent = 4, Received = 4, Lost = 0 (0% loss),
Minimum = 0.94ms, Maximum = 1.08ms, Average = 1.03ms
PsPing v2.10 - PsPing - ping, latency, bandwidth measurement utility Copyright (C) 2012-2016 Mark Russinovich Sysinternals - www.sysinternals.com Pinging ::1 with 32 bytes of data: 5 iterations (warmup 1) ping test: Reply from ::1: 0.98ms Reply from ::1: 0.51ms Reply from ::1: 0.65ms Reply from ::1:
1.14ms Reply from ::1: 1.47ms Ping statistics for ::1: Sent = 4, Received = 4, Lost = 0 (0% loss), Minimum = 0.51ms, Maximum = 1.47ms, Average = 0.94ms
Question: Why are you using both $t and $g?
Just curious.
Also, why psping, vs, just ping or Test-Connection, Test-NetConnection for general liveliness validation?
Thanks everyone! I ended up restarting my console and then I got consistent results. I must have strongly typed my $t variable as [string] and not strongly typed $g earlier on in my testing.
I wanted to strongly type $t for my test so that I could then use $t.contains(“0% loss”) as the condition in my connectivity script. I still use test-netconnection, however I think it’s best to build a script with three concurrent successful tests to any port to validate it is open. Another reason I like PSPing utility is that it runs very vast and does not try to resolve DNS. I’ve also found that test-netconnection cmdlet is much slower that PSPing.