Metrics for failing scheduled scripts

Hey, I’m new to Powershell Universal and wanted to look at how we could monitor/alert on failing scheduled scripts (outside of checking the dashboard).

Anyone doing something here? I’ve hooked into AppInsights but it doesn’t look like I get any metrics around those

we have a trigger that fires off and sends a notification in a teams channel

you can query the backend database for recent failed jobs like this

select * from job where [status] in (11,3) and EndTime>getdate()-1