PowerShell Communicating with RESTful APIs Use Slack.com Incoming Webhooks


Example

Define your payload to send for possible more complex data

$Payload = @{ text="test string"; username="testuser" }

Use ConvertTo-Json cmdlet and Invoke-RestMethod to execute the call

Invoke-RestMethod -Uri "https://hooks.slack.com/services/yourwebhookstring" -Method Post -Body (ConvertTo-Json $Payload)