From 91526bd1ee55ed29a53dead3e144e50e83f3ec71 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 20 Mar 2023 11:06:45 +0100 Subject: [PATCH] Update check-dns.ps1 and check-ping.ps1 --- Scripts/check-dns.ps1 | 2 +- Scripts/check-ping.ps1 | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Scripts/check-dns.ps1 b/Scripts/check-dns.ps1 index 086a553c..a76df84a 100755 --- a/Scripts/check-dns.ps1 +++ b/Scripts/check-dns.ps1 @@ -13,7 +13,7 @@ #> try { - Write-Progress "⏳ Resolving 200 popular domains..." + Write-Progress "⏳ Resolving 200 popular domain names..." $table = Import-CSV "$PSScriptRoot/../Data/popular-domains.csv" $numRows = $table.Length diff --git a/Scripts/check-ping.ps1 b/Scripts/check-ping.ps1 index ae9131fc..4adfdf31 100755 --- a/Scripts/check-ping.ps1 +++ b/Scripts/check-ping.ps1 @@ -7,7 +7,7 @@ Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com) .EXAMPLE PS> ./check-ping - ✅ Ping latency is 13ms...109ms, 25ms average. + ✅ Ping latency is 13ms...109ms with 25ms average. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -20,7 +20,6 @@ try { Write-Progress "⏳ Sending a ping to 9 popular hosts..." $HostsArray = $hosts.Split(",") $Pings = Test-Connection -computerName $HostsArray -count 1 - Write-Progress -Completed "." [int]$Min = 9999999 [int]$Max = [int]$Avg = 0 @@ -31,7 +30,9 @@ try { $Avg += $Latency } $Avg /= $Pings.count - Write-Host "✅ Ping latency is $($Min)ms...$($Max)ms, $($Avg)ms average" + + Write-Progress -Completed "." + Write-Host "✅ Ping latency is $($Min)ms...$($Max)ms with $($Avg)ms average" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"