From 62eb13ae0ea9797fbfe3631066a4d504c9f4f097 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 23 Dec 2022 19:02:04 +0100 Subject: [PATCH] Update check-dns.ps1 --- Scripts/check-dns.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Scripts/check-dns.ps1 b/Scripts/check-dns.ps1 index fd57648c..ddaa56a0 100755 --- a/Scripts/check-dns.ps1 +++ b/Scripts/check-dns.ps1 @@ -12,21 +12,20 @@ #> try { - Write-Progress "⏳ Step 1/2 - Reading from Data/frequent-domains.csv..." + Write-Progress "⏳ (1/2) Loading Data/frequent-domains.csv..." $Table = Import-CSV "$PSScriptRoot/../Data/frequent-domains.csv" $NumRows = $Table.Length - Write-Progress "⏳ Step 2/2 - Resolving $NumRows domains..." + Write-Progress "⏳ (2/2) Resolving $NumRows domains..." $StopWatch = [system.diagnostics.stopwatch]::startNew() if ($IsLinux) { foreach($Row in $Table){$nop=dig $Row.Domain +short} } else { foreach($Row in $Table){$nop=Resolve-DNSName $Row.Domain} } - [float]$Elapsed = $StopWatch.Elapsed.TotalSeconds - $Average = [math]::round($NumRows / $Elapsed, 1) + $Average = [math]::round($NumRows / $Elapsed, 1) if ($Average -gt 10.0) { "✅ DNS resolves $Average domains per second" } else { @@ -36,4 +35,4 @@ try { } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 -} +} \ No newline at end of file