Install

Save-Module Universal.Notifications -Path $Env:ProgramData\UniversalAutomation\Repository\Modules

The above command assumes you are running with default settings. You can also install modules from within the PowerShell Universal admin console by clicking Platform \ Modules. Click here for more information about installing PowerShell Universal modules.

Version

0.0.4

Last Updated

Wednesday, 14 June 2023

Tags

PowerShellUniversal

Author

Ironman Software

Universal.Notifications

A collection of functions for sending notifications in PowerShell Universal. This module requires PowerShell Universal v4.

Send-PSUFailedJobEmail

This notification can be used with a trigger to send a failed job email. You will need to configure the following variables for this to work.

New-PSUVariable -Name "EmailServer" -Value '' -Description "The SMTP server to use for email. " 
New-PSUVariable -Name "EmailUser" -Value '' -Description "The username for authenticaitng to your email server. " 
New-PSUVariable -Name "ToEmail" -Value '' -Description "The email address to send email notifications to. " 
New-PSUVariable -Name "FromEmail" -Value '' -Description "The email address to send notifications from." 
New-PSUVariable -Name "EmailPassword" -Vault "BuiltInLocalVault" -Description "The password for authenticating against the email server. "

Once the variables are configured, you can setup a trigger to send emails.

New-PSUTrigger -Name "Failed Job Email" -EventType "JobFailed" -TriggerScript "Universal.Notifications\Send-PSUFailedJobEmail"

Send-PSUFailedJobSlackNotification

This command can be used with a trigger to send a failed job Slack notification. You will need to configure the following variables for this to work.

New-PSUVariable -Name "SlackUrl" -Description "The Slack web hook URL."

Once the variables are configured, you can setup a trigger to send notifications.

New-PSUTrigger -Name "Failed Job Slack Notification" -EventType "JobFailed" -TriggerScript "Universal.Notifications\Send-PSUFailedJobSlackNotification"

Send-PSUFailedJobTeamsNotification

This command can be used with a trigger to send a failed job Microsoft Teams notification. You will need to configure the following variables for this to work.

New-PSUVariable -Name "TeamsUrl" -Description "The Microsoft teams web hook URL."

Once the variables are configured, you can setup a trigger to send notifications.

New-PSUTrigger -Name "Failed Job Teams Notification" -EventType "JobFailed" -TriggerScript "Universal.Notifications\Send-PSUFailedJobTeamsNotification"