In the olden days twitter was a great way of reporting build statuses using a simple commandline. These days it seems twitter is more the domain of plutocrats and the bots who love them. I was sad when the twitter api was restricted, but rejoice, Slack is here!
Slack has become a very popular information hub for teams. Because of Slack’s simple rest api it’s simple to report to a channel.
1. Create a “slack application”
Use this Url : https://api.slack.com/apps to go to the apps screen
2. Enable Webhooks
3. Copy the “Webhook Url”
4. Use this code in your powershell script…
$postSlackMessage = ‘{“text”:”hello world!'”}’
Invoke-RestMethod -Method Post -Uri yourwebhookurl -Body $postSlackMessage