mirror of
https://github.com/janikvonrotz/awesome-powershell.git
synced 2025-01-11 07:19:24 -05:00
Performance optimization
Updated Invoke-Webrequest to use the method 'head' to save time.
This commit is contained in:
parent
0041efd957
commit
8eb406734d
@ -14,7 +14,7 @@
|
|||||||
Write-Host "Requesting url $url"
|
Write-Host "Requesting url $url"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$request = Invoke-WebRequest -Uri $url
|
$request = Invoke-WebRequest -Uri $url -DisableKeepAlive -UseBasicParsing -Method head
|
||||||
} catch {
|
} catch {
|
||||||
Write-Warning -Message "Found dead url $url in $fileName"
|
Write-Warning -Message "Found dead url $url in $fileName"
|
||||||
$unreachable += $url
|
$unreachable += $url
|
||||||
@ -33,4 +33,4 @@ if ($DeadLinks) {
|
|||||||
Write-Host -Object $DeadLink -ForegroundColor Red
|
Write-Host -Object $DeadLink -ForegroundColor Red
|
||||||
}
|
}
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user