PSTeams

by EvotecIT

EvotecIT / PSTeams

This PowerShell Module allows to sending notifications to Microsoft Teams. It's pretty flexible and ...

167 Stars 20 Forks Last release: 3 months ago (v1.0.5) MIT License 134 Commits 6 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

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.5 / 2020.08.10
    • [x] Fix for ActivityImage images not working correctly #22
  • 1.0.4 / 2020.07.29
    • [x] Small update to error handling
  • 1.0.3 / 2020.07.29
    • [x] Small update to
      Send-TeamsMessage
      to potentially display warning if cmdlet fails
    • [x] Renamed
      Supress
      to
      Suppress
      in
      Send-TeamsMessage
      - this will hunt me forever all over my modules (left alias in place)
  • 1.0.2 / 2020.07.28
    • [x] Added missing images
      New-TeamsActivityImage
  • 1.0.1 / 2020.07.28
    • [x] Module is now signed
    • [x] Added
      ConvertTo-TeamsFact
      - tnx theramiyer #15
    • [x] Added
      ConvertTo-TeamsSection
      - tnx theramiyer #15
    • [x] Fixed problem with missing image
    • [x] Added missing image choice
  • 1.0.0 / 2019.12.22 - full blog post
    • [x] New way of sending to Teams, old way still works
    • [x] Added new aliases
    • [x] Reworked lists/list items creation
    • [x] Removed Enums in favour of ArgumentCompleters with strings.
    • [x] Changed 149 colors into 800 (+-) colors (same as PSWriteHTML)
  • 0.6.0 / 2019.04.12
    • [x] Stability issues
  • 0.4.0 / 2019.04.03
    • [x] fix for UTF-8 charset - (provided by hjorslev)
    • [x] 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

    • [x] added cross-platform (works on linux, mac os, windows)
    • [x] added azure pipelines
    • [x] 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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.