Created
August 17, 2019 07:53
-
-
Save akhilvatts/55a728a4d2a2f155d9194ffb01c4aecc to your computer and use it in GitHub Desktop.
Script to send Message to Slack and Mattermost
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
$payload = @{ | |
"channel" = "#channel" | |
"icon_emoji" = ":fire:" | |
"text" = "Hello there! I guess there's something wrong. Would you please mind checking the API system." | |
"username" = "Mr. API System" | |
} | |
Invoke-RestMethod ` | |
-Body (ConvertTo-Json -Compress -InputObject $payload) ` | |
-Method Post ` | |
-ContentType 'application/json' ` | |
-Uri "https://hooks.collabservice.com/services/HOOK_API_SLUG" | Out-Null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment