Created
December 31, 2019 01:09
-
-
Save a5ync/6fb75c72177df73794b5026e6e48b9e8 to your computer and use it in GitHub Desktop.
Send notification from Devops to Teams
This file contains hidden or 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
| $teamsNotification = @{ | |
| '@type' = 'MessageCard' | |
| '@context'= 'http://schema.org/extensions' | |
| 'themeColor' = '0076D7' | |
| 'summary' = 'Successful build notification' | |
| 'sections' = @( | |
| @{ | |
| 'activityTitle' = "$(Build.DefinitionName)" | |
| 'activitySubtitle' = "image tag $(Build.BuildNumber) deployed to registry" | |
| }) | |
| } | |
| $json = $teamsNotification | ConvertTo-Json | |
| $params = @{ | |
| Uri = 'https://outlook.office.com/webhook/your_webhook_magic_link' | |
| Method = 'POST' | |
| Body = $json | |
| ContentType = 'application/json' | |
| } | |
| Invoke-RestMethod @params |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment