Skip to content

Instantly share code, notes, and snippets.

@junkangli
Created May 17, 2018 09:01
Show Gist options
  • Save junkangli/640d4c6bc786aa3d812e40a3e50ae2c7 to your computer and use it in GitHub Desktop.
Save junkangli/640d4c6bc786aa3d812e40a3e50ae2c7 to your computer and use it in GitHub Desktop.
PowerShell script to post a notification to a chat room
$apitoken = <redacted>
$roomid = "20"
$messageText = "message_goes_here"
$color = 'yellow'
$body = @{
color = $color
message = $messageText
notify = $true
message_format = "text"
}
$uri = "https://<hipchat_domain_name>/v2/room/$roomid/notification?auth_token=$apitoken"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Method Post -Uri $uri -Body $body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment