RamblingCookieMonster / PSSlack

PowerShell module for simple Slack integration
http://ramblingcookiemonster.github.io/PSSlack/
MIT License
274 stars 74 forks source link

Send-SlackMessage does not specify ContentType. #85

Open gilmarwsr opened 5 years ago

gilmarwsr commented 5 years ago

Test Case

Send a simple message: $web_hook_addr = "//hooks.slack.com/services/{...}" Send-SlackMessage -Uri $web_hook_addr -Text 'Atenção'

Expected Behavior

incoming-webhook APP [1:28 PM] Atenção

Current Behavior

incoming-webhook APP [1:28 PM] AtenBAD+7BAD+3o

Possible Solution

Create a new parameter ContentType in the file SendSlackMessage.ps1 with default value "text/plain; charset=utf-8".

Use the new contentType parameter: Invoke-RestMethod @ProxyParam -Method Post -Body $json -Uri $Uri -ContentType $ContentType

Context

I´m use this excelent powershell module to send some backend events to a multi-language team, i have some issues with messages were written in portuguese.

RamblingCookieMonster commented 5 years ago

Hiyo!

This sounds good to me. I could even see this as a PSSlackConfig setting. If anyone wants to submit a PR, feel free!