Last active
November 10, 2021 21:08
-
-
Save CraigChamberlain/4db39ebb4339ee11cc5e9cd817e3dcbf to your computer and use it in GitHub Desktop.
Makes
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
while($true){ | |
$timeStamp = (Get-Date).toString('yyyy-MM-dd-HH-mm-ss') | |
$path = $pwd.Path + "\" + $timeStamp + ".txt" | |
Start-Job{ | |
try{ | |
Invoke-WebRequest https://www.dundasparksgolf.co.uk/ > $null | |
"Success`t"+$using:timeStamp | |
} catch | |
{ | |
$error[0] > $using:path | |
"Failure`t"+$using:timeStamp | |
} | |
} > $null | |
Start-Sleep 60 | |
Get-Job | Where-Object {$_.State -in "Completed", "Failed"} | Receive-Job -Wait -AutoRemoveJob | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment