Skip to content

Instantly share code, notes, and snippets.



Last active Nov 22, 2017
What would you like to do?
PowerShell function that sends a message to Slack
function NotifySlack($webhookurl, $channel, $message)
$payload = @{
"channel" = $channel
"icon_emoji" = ":robot_face:"
"text" = $message
"username" = "Mr. Robot"
Invoke-WebRequest -UseBasicParsing -Body (ConvertTo-Json -Compress -InputObject $payload) -Method Post -Uri $webhookurl | Out-Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.