# 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 pl

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

[Zobacz obrazy (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

[!\[Powiadomienie Microsoft Teams wyslane z Azure Pipelines po zakonczeniu testow Linux\](/wp-content/uploads/2018/10/img_5bb6509e8013e.png)](/wp-content/uploads/2018/10/img_5bb6509e8013e.png)

**Windows** tests

[!\[Powiadomienie Microsoft Teams wyslane z Azure Pipelines po zakonczeniu testow Windows\](/wp-content/uploads/2018/10/img_5bb650ade0d73.png)](/wp-content/uploads/2018/10/img_5bb650ade0d73.png)

And finally **MacOS** tests

[!\[Powiadomienie Microsoft Teams wyslane z Azure Pipelines po zakonczeniu testow macOS\](/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.

[!\[Powiadomienie o zdarzeniu Active Directory wyslane na zywo do Microsoft Teams przez 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.

## Powiązane projekty

Projekty powiązane z tagami, kategoriami i treścią tego wpisu.

[Wszystkie projekty](/projekty/)

Trwa dopasowywanie projektów...

[Powrót do bloga](/blog/)

## Powiązane wpisy

- [Check an API write after a PowerShell timeout](/blog/verify-uncertain-api-outcomes-powershell/)
- [Inspect and convert mixed Office archives with PSWriteOffice](/blog/inspect-and-convert-mixed-office-archives-pswriteoffice/)
- [Compose PDF reports and automate page workflows with PSWriteOffice](/blog/automate-pdf-reports-and-page-workflows-pswriteoffice/)

<!-- PowerForge markdown artifact sha256:FEBE18C5D598C4EAF4C4960C77C313DB8F983FE0AC80C37D72C59D66AE67AB29 -->
