The Powershell module simplifies the generation of MessageCard JSON. The JSON is suitable for posting to a Microsoft Teams incoming webhook to produce a rich text message.
The module support generation of simple and more advanced card with sections, facts and buttons to open uri's
Do not forget that Get-Help is your friend!
Clone or download the module and put it in your module path.
You need Windows or Linux and PowerShell
Import-Module MessageCard
$act = New-MessageCardActionOpenURI -Name "Open GitHub" -Uri "https://github.com"
$fct = New-MessageCardFact -name 'Date' -Value '2012-12-12'
$fct2 = New-MessageCardFact -name 'Info' -Value 'Multiple Facts are possible'
$sct = New-MessageCardSection -Title "This is a section test" -Text "This is text to show in this sections body, there can be multiple sections" -Facts $fct,$fact2 -potentialAction $act
$card = New-MessageCard -Title "The card title" -Sections $sct
$uri = "https://outlook.office.com/webhook/your-uniq-hook-here"
Invoke-RestMethod -Uri $uri -body $card -Method Post -ContentType 'application/json'
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Henrik Hellerstedt - Initial work - henhell
See also the list of contributors who participated in this project.
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details