Created
May 17, 2018 09:01
-
-
Save junkangli/640d4c6bc786aa3d812e40a3e50ae2c7 to your computer and use it in GitHub Desktop.
PowerShell script to post a notification to a chat room
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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