From 18b4f0ed0f017f053465c2573fd6f169af095270 Mon Sep 17 00:00:00 2001 From: dinger1986 Date: Sun, 10 Jan 2021 17:53:53 +0000 Subject: [PATCH] Runs DNS check on host as defined --- scripts/dnscheck.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/dnscheck.ps1 b/scripts/dnscheck.ps1 index b766939d..4e535b8a 100644 --- a/scripts/dnscheck.ps1 +++ b/scripts/dnscheck.ps1 @@ -4,17 +4,17 @@ $hostname = 'bbc.com' ## allowed time for DNS check to be done (Milliseconds) $time = 100 -write-host -NoNewLine "Verifying" $hostname " ... " +write-Output -NoNewLine "Verifying" $hostname " ... " ## Do a ping test to ensure hostname can be contacted if (Test-Connection $hostname -Count 1 -ErrorAction SilentlyContinue) { - write-host "Ping test passed for $hostname" + write-Output "Ping test passed for $hostname" } else { - write-host "Ping Test Failed for $hostname" + write-Output "Ping Test Failed for $hostname" exit 1 } @@ -44,7 +44,7 @@ if($test) Write-Output "Time taken: $timetaken Milliseconds" if ($timetaken -ge $time) { - write-host "DNS lookup for $hostname took longer than $time Milliseconds" + write-Output "DNS lookup for $hostname took longer than $time Milliseconds" exit 1 } else @@ -55,4 +55,4 @@ if ($timetaken -ge $time) } -Exit $LASTEXITCODE \ No newline at end of file +Exit $LASTEXITCODE