Skip to content

PSTeams is a PowerShell Module working on Windows / Linux and Mac. It allows sending notifications to Microsoft Teams via WebHook Notifications. It's pretty flexible and provides a bunch of options. Initially, it only supported one sort of Team Cards but since version 2.X.X it supports Adaptive Cards, Hero Cards, List Cards, and Thumbnail Cards.…

License

Notifications You must be signed in to change notification settings

EvotecIT/PSTeams

Repository files navigation

PSTeams - PowerShell Module

PSTeams is a PowerShell Module working on Windows / Linux and Mac. It allows to send notifications to Microsoft Teams. It's pretty flexible and provides a bunch of options.

For description and advanced usage visit PSTeams dedicated page.

Readme Links

While I didn't spent much time creating WIKI, working on Get-Help documentation, I did write 3 articles that should help you get started.

Updates

  • 1.0.1 / 2020.07.28

    • Module is now signed
    • Added ConvertTo-TeamsFact - tnx theramiyer #15
    • Added ConvertTo-TeamsSection - tnx theramiyer #15
    • Fixed problem with missing image
    • Added missing image choice
  • 1.0.0 / 2019.12.22 - full blog post

    • New way of sending to Teams, old way still works
    • Added new aliases
    • Reworked lists/list items creation
    • Removed Enums in favour of ArgumentCompleters with strings.
    • Changed 149 colors into 800 (+-) colors (same as PSWriteHTML)
  • 0.6.0 / 2019.04.12

    • Stability issues
  • 0.4.0 / 2019.04.03

    • fix for UTF-8 charset - (provided by hjorslev)
    • emoji support added - (provided by hjorslev) - to use it you may need UTF-8 with BOM file encoding
  • 0.3.x / 2019.02.21 -[x] added summary for message that is visible in Activity pane

  • 0.2.x / 2018.10.04 - full blog post

    • added cross-platform (works on linux, mac os, windows)
    • added azure pipelines
    • added some pester tests
  • 0.1.x / 2018.07.12 [x] first release

Documentation for Message Cards (for development)

This module uses Message Cards to send information to Teams. You can find out what is supported in Legacy actionable message card reference just in case you would like to help out with development of this module.

Additional links:

Teams Card Explanatiuion

Teams Card Explanatiuion

Teams Card Explanatiuion

Send-TeamsMessage -Verbose {
    New-TeamsSection -ActivityTitle "**Elon Musk**" -ActivitySubtitle "@elonmusk - 9/12/2016 at 5:33pm" -ActivityImageLink "https://pbs.twimg.com/profile_images/782474226020200448/zDo-gAo0.jpg" -ActivityText "Climate change explained in comic book form by xkcd xkcd.com/1732"
    New-TeamsSection -ActivityTitle "**Mark Knopfler**" -ActivitySubtitle "@MarkKnopfler - 9/12/2016 at 1:12pm" -ActivityImageLink "https://pbs.twimg.com/profile_images/1042367841117384704/YvrqQiBK_400x400.jpg" -ActivityText "Mark Knopfler features on B.B King's all-star album of Blues greats, released on this day in 2005..."
    New-TeamsSection -ActivityTitle "**Elon Musk**" -ActivitySubtitle "@elonmusk - 9/12/2016 at 5:33pm" -ActivityImageLink "https://pbs.twimg.com/profile_images/782474226020200448/zDo-gAo0.jpg" -ActivityText "Climate change explained in comic book form by xkcd xkcd.com/1732"
} -Uri $TeamsID -MessageSummary 'Tweet'

Installing on Windows / Linux / MacOS

Install-Module PSTeams
#Install-Module PSTeams -Scope CurrentUser
#Update-Module PSTeams

Usage

$TeamsID = 'YourCodeGoesHere'
$Button1 = New-TeamsButton -Name 'Visit English Evotec Website' -Link "https://evotec.xyz"
$Fact1 = New-TeamsFact -Name 'PS Version' -Value "**$($PSVersionTable.PSVersion)**"
$Fact2 = New-TeamsFact -Name 'PS Edition' -Value "**$($PSVersionTable.PSEdition)**"
$Fact3 = New-TeamsFact -Name 'OS' -Value "**$($PSVersionTable.OS)**"
$CurrentDate = Get-Date
$Section = New-TeamsSection `
    -ActivityTitle "**PSTeams**" `
    -ActivitySubtitle "@PSTeams - $CurrentDate" `
    -ActivityImage Add `
    -ActivityText "This message proves PSTeams Pester test passed properly." `
    -Buttons $Button1 `
    -ActivityDetails $Fact1, $Fact2, $Fact3
Send-TeamsMessage `
    -URI $TeamsID `
    -MessageTitle 'PSTeams - Pester Test' `
    -MessageText "This text won't show up" `
    -Color DodgerBlue `
    -Sections $Section

How does it look like

  • When executed from Linux

image

  • When executed from Windows

image

  • When executed from MacOS

image

image

About

PSTeams is a PowerShell Module working on Windows / Linux and Mac. It allows sending notifications to Microsoft Teams via WebHook Notifications. It's pretty flexible and provides a bunch of options. Initially, it only supported one sort of Team Cards but since version 2.X.X it supports Adaptive Cards, Hero Cards, List Cards, and Thumbnail Cards.…

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •