en-US/about_PSSlack.help.txt
PSTOPIC
about_PSSlack SHORT DESCRIPTION PSSlack allows you to work with the Slack API through PowerShell functions LONG DESCRIPTION PSSlack allows you to work with the Slack API through PowerShell functions You can find API documentation here: https://api.slack.com/web https://api.slack.com/methods DETAILED DESCRIPTION Using PSSlack requires that you have a token or incoming webhook URI from Slack. Details on authentication via tokens in Slack: https://api.slack.com/docs/oauth Obtain a simple test token for Slack: https://api.slack.com/docs/oauth-test-tokens Set up an Incoming Webhook for your team: https://api.slack.com/incoming-webhooks https://my.slack.com/services/new/incoming-webhook/ (note: pick the right team in the URL or the top right) Once you have a token or Uri, you are ready to roll! If you want to save time, you can store your token, Uri, and other data using Set-PSSlackConfig These will be used for default values in several commands. AUTHORIZATION We don't get fancy with parametersets. Here's a breakdown of how we pick Uri or Token: Parameters are used before Set-PSSlackConfig settings Tokens are used before Uri Examples: Uri parameter specified, token exists in Set-PSSlackConfig: Uri is used Uri and token exist in Set-PSSlackConfig: token is used Token and Uri parameters are specified: Token is used OUTPUT The Slack API and Incoming Webhook alter the output Send-SlackMessage will provide. If you use a Uri for an Incoming Webhook, Slack will return a string: "ok" if the call succeeded An error string if something went wrong If you use a token, we get a bit more detail back: ok : True channel : D0ST7FE6Q ts : 1463254594.000027 message : @{text=; username=Slack API Tester; icons=; attachments=System.Object[]; type=message;... link : ArchiveUri.From.Set-PSSlackConfig/D0ST7FE6Q/p1463254594000027 If you use a token and things don't go so well, the OK field will not be true: ok error -- ----- False channel_not_found |