Send notifications to Slack and Teams

This is work in progress, in the meantime, please see this blogpost:

The integration with Slack is similar and also entails triggering a WebHook. The configuration is slightly different from Teams:

$webhookurl = "https://hooks.slack.com/services/xxx"
$body = ConvertTo-Json @{
    pretext = "{SUBJECT}"
    text = "{BODY}"
}

Invoke-RestMethod `
    -Uri $webhookurl `
    -Method Post `
    -Body $body `
    -ContentType 'application/json'

Last updated