From 8eb406734d587f6b7bb26726cd009438901a5188 Mon Sep 17 00:00:00 2001 From: David das Neves Date: Tue, 16 Jun 2020 17:31:34 +0200 Subject: [PATCH] Performance optimization Updated Invoke-Webrequest to use the method 'head' to save time. --- DeadLinksAnalyzer.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DeadLinksAnalyzer.ps1 b/DeadLinksAnalyzer.ps1 index 87a4120..19be74c 100644 --- a/DeadLinksAnalyzer.ps1 +++ b/DeadLinksAnalyzer.ps1 @@ -14,7 +14,7 @@ Write-Host "Requesting url $url" try { - $request = Invoke-WebRequest -Uri $url + $request = Invoke-WebRequest -Uri $url -DisableKeepAlive -UseBasicParsing -Method head } catch { Write-Warning -Message "Found dead url $url in $fileName" $unreachable += $url @@ -33,4 +33,4 @@ if ($DeadLinks) { Write-Host -Object $DeadLink -ForegroundColor Red } exit 1 -} \ No newline at end of file +}