Skip to content

Instantly share code, notes, and snippets.

@aaldrich29
aaldrich29 / Send-SlackMessage.ps1
Created April 22, 2016 14:31
Send Slack Message from PowerShell
function Send-SlackMessage {
# Add the "Incoming WebHooks" integration to get started: https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
param (
[Parameter(Mandatory=$true, Position=0)]$Text,
$Url="https://hooks.slack.com/services/xxxxx", #Put your URL here so you don't have to specify it every time.
# Parameters below are optional and will fall back to the default setting for the webhook.
$Username, # Username to send from.
$Channel, # Channel to post message. Can be in the format "@username" or "#channel"
$Emoji, # Example: ":bangbang:".
$IconUrl # Url for an icon to use.