Windows Task Scheduler
Ping from PowerShell and report failures with the exit code.
PowerShell
At the end of the scheduled script:
Invoke-WebRequest -UseBasicParsing -TimeoutSec 10 -Uri "https://vivere.dev/p/<monitor-id>" | Out-Null
Reporting failures, with the script's output as the log:
Invoke-WebRequest -UseBasicParsing -Uri "https://vivere.dev/p/<monitor-id>/start" | Out-Null
$output = & .\job.ps1 2>&1 | Out-String
$code = if ($?) { 0 } else { 1 }
Invoke-WebRequest -UseBasicParsing -Method Post -Uri "https://vivere.dev/p/<monitor-id>/$code" -Body $output -ContentType "text/plain" | Out-Null
exit $code
Task Scheduler with the CLI
Download vivere.exe (see CLI) and set the task's action to:
Program: C:\Tools\vivere.exe
Arguments: run --url https://vivere.dev/p/<monitor-id> -- powershell.exe -NoProfile -File C:\Jobs\job.ps1
Or from the command line:
schtasks /Create /SC DAILY /ST 02:00 /TN "Nightly job" /TR "C:\Tools\vivere.exe run --url https://vivere.dev/p/<monitor-id> -- powershell.exe -NoProfile -File C:\Jobs\job.ps1"
Batch files
call C:\Jobs\job.bat
curl -fsS -m 10 https://vivere.dev/p/<monitor-id>/%ERRORLEVEL%