Last active
August 8, 2022 13:49
-
-
Save iamsunny/b39deaf90bf7e1dabc9e927e52e8829d to your computer and use it in GitHub Desktop.
Loop Invoke-WebRequest in Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TrustAllCertsPolicy : System.Net.ICertificatePolicy { | |
[bool] CheckValidationResult([System.Net.ServicePoint] $a, | |
[System.Security.Cryptography.X509Certificates.X509Certificate] $b, | |
[System.Net.WebRequest] $c, | |
[int] $d) { | |
return $true | |
} | |
} | |
[System.Net.ServicePointManager]::CertificatePolicy = [TrustAllCertsPolicy]::new() | |
$count=1 | |
while($true){ | |
write-host $count | |
Invoke-Webrequest "https://docs.testthedocs.ml" > 1 | |
$count++ | |
} | |
########################################################################################### | |
$curlAlias = get-alias -name curl -ErrorAction SilentlyContinue | |
if($curlAlias.count -gt 0) | |
{ Remove-item alias:curl} | |
while(1) | |
{ | |
#$url = "https://newp37.document360.net" | |
#$url = "https://toc-check.document360.info" | |
#$url = "https://docs.testthedocs.ml" | |
#$url = "https://docs.document360.io" | |
#$url = "https://api.document360.net" | |
$url = "https://www.google.com" | |
curl -o /dev/null -s -w 'Total: %{time_total}s\n' $url | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment