# PSTeams – Send notifications to MS Teams from Mac / Linux or Windows

If you’re new to this module it’s very simple PowerShell module allowing to send notifications straight to Microsoft Teams channels….

blog

04 Oct 2018 fr

![PSTeams  – Send notifications to MS Teams from Mac / Linux or Windows](/wp-content/uploads/2018/10/img_5bb650be35f4b.png)

[Voir les images (4)](#pf-content-image-1-0)

If you're new to this module it's very simple **PowerShell** module allowing to send notifications straight to **Microsoft Teams** channels. Full overview of this module is available on dedicated page for [**PSTeams**](https://evotec.xyz/hub/scripts/psteams-powershell-module/). New release version **0.2** is small addition to **PowerShell** **cross-platform** modules allowing you to run it on Windows, Linux or Mac. This means from **now on** you can tell your scripts on Linux to send information straight to Microsoft Teams!

> Please notice this article **contains parts of information **(still useful) and **may not reflect all functionalities of this module**. For download, source code and so on you should refer to the dedicated [**PSTeams **](https://evotec.xyz/hub/scripts/psteams-powershell-module/)module page. After reading this one… of course! It contains useful *information*, *examples *and *know-how*. Without it… you may be lost!

### 💡 How can I use it?

To use it on Windows / Linux or Mac simply run

```powershell
Install-Module PSTeams
# Update-Module PSTeams
```

### 💡 Useful links

- 💬 Code is published on [GitHub](https://github.com/EvotecIT/PSTeams)
- 💬 Issues should be reported on [GitHub](https://github.com/EvotecIT/PSTeams/issues)
- 💬 Code is published as a module on [PowerShellGallery](https://www.powershellgallery.com/packages/PSTeams/)

### 💡 Azure Pipelines / Pester Testing

I've actually used this release as a testing ground for **Azure Pipelines **([Azure DevOps](https://azure.microsoft.com/en-us/blog/introducing-azure-devops/)) that allows for testing **PowerShell** modules on all 3 platforms (**Windows** / **Linux** and **Mac**) along with using Secret/Private Key (Teams Channel ID). I've actually written simple Pester for this scenario that sends a message to my testing Microsoft Teams channel with information when testing on each platform is done. So when I commit new changes to **GitHub**** **I expect to get new notifications in Teams.It actually sends a bit of information each time it does that. So below you can see Linux tests

[!\[Microsoft Teams notification posted from Azure Pipelines after Linux tests completed\](/wp-content/uploads/2018/10/img_5bb6509e8013e.png)](/wp-content/uploads/2018/10/img_5bb6509e8013e.png)

**Windows** tests

[!\[Microsoft Teams notification posted from Azure Pipelines after Windows tests completed\](/wp-content/uploads/2018/10/img_5bb650ade0d73.png)](/wp-content/uploads/2018/10/img_5bb650ade0d73.png)

And finally **MacOS** tests

[!\[Microsoft Teams notification posted from Azure Pipelines after macOS tests completed\](/wp-content/uploads/2018/10/img_5bb650be35f4b.png)](/wp-content/uploads/2018/10/img_5bb650be35f4b.png)

This also shows how useful it can be for random scripts you run in your environment. You can simply add notification before/after with some specific information that you need such as script executed successfully, user was added to AD and so on. My current biggest use case for this is my [**PSWinReporting**](https://evotec.xyz/hub/scripts/pswinreporting-powershell-module/) project that sends updates **Live **as they happen on **Active Directory **telling me that user was added or removed from group or that he changed his password.

[!\[Live Active Directory event notification sent to Microsoft Teams by PSWinReporting\](/wp-content/uploads/2018/09/img_5b9e830101081.png)](/wp-content/uploads/2018/09/img_5b9e830101081.png)

So if you're into starting it up…

```powershell
$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
```

> Please notice this article **contains parts of information **(still useful) and **may not reflect all functionalities of this module**. For download, source code and so on you should refer to the dedicated [**PSTeams **](https://evotec.xyz/hub/scripts/psteams-powershell-module/)module page. After reading this one… of course! It contains useful *information*, *examples *and *know-how*. Without it… you may be lost!

This is the code responsible for what you see on **Pester** tests. So have fun. Make sure to check main [**PSTeams**](https://evotec.xyz/hub/scripts/psteams-powershell-module/)article for a full know-how.

## Projets associés

Projets liés aux tags, catégories et au contenu de cet article.

[Tous les projets](/fr/projets/)

Recherche des projets associés...

[Retour au blog](/blog)

## Articles associés

- [Adaptive Cards with Tables and Linebreaks in Microsoft Teams](/fr/blog/adaptive-cards-with-tables-and-linebreaks-in-microsoft-teams/)
- [Mentioning users in notifications using PSTeams PowerShell Module](/fr/blog/mentioning-users-in-notifications-using-psteams-powershell-module/)
- [PSWinReporting – Forwarders, Microsoft Teams, Slack, Microsoft SQL and more](/fr/blog/pswinreporting-forwarders-microsoft-teams-slack-microsoft-sql-and-more/)

<!-- PowerForge markdown artifact sha256:965111C51B5337E7907EAC014999E05C7A8CCCC0765CA778122645037A72BCB3 -->
