virtualcenter


Our IT journal

Use PowerShell to post to a Slack channel with extra args

You need to create an application in Slack with incoming webhooks. Enable the application and confirm your identity. Copy that webhook. Invoke the script with system variables to post extra content for alerts, automation, escalations, etc. $message = “`n” + $args Set-StrictMode -Version Latest $payload = @{ “channel” = “#alerts”; “icon_emoji” = “:inbox_tray:”; “text” = $(Write-output “$message”); “username” = “User”; … Read More