Skip to content

Instantly share code, notes, and snippets.

@Wesley-Lomax
Created June 26, 2018 13:24
Show Gist options
  • Save Wesley-Lomax/3977df337147c3d39936782be388ac53 to your computer and use it in GitHub Desktop.
Save Wesley-Lomax/3977df337147c3d39936782be388ac53 to your computer and use it in GitHub Desktop.
Fire web request at server with loop
$targetSite = "https://hostname"
Write-Host "Requesting " $targetSite
while($true)
{
Invoke-WebRequest -TimeoutSec 120 -method head -Uri $targetSite | Select-Object StatusCode, StatusDescription
Start-Sleep -Seconds 60
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment