Skip to content

Instantly share code, notes, and snippets.

@gpsarkar
Last active April 25, 2018 18:50
Show Gist options
  • Save gpsarkar/5da3dcf384b798db01e15313a40aa67a to your computer and use it in GitHub Desktop.
Save gpsarkar/5da3dcf384b798db01e15313a40aa67a to your computer and use it in GitHub Desktop.
$webhook = "SLACK INCOMING WEBHOOK URL"
$attachments = @(@{
"pretext" = "Lab 7 Smoke Test"
"color"="danger"
"text"= "14/43 failed (5 mins)"
})
$payload =
@{
"attachments" = $attachments
}
Invoke-WebRequest `
-Body (ConvertTo-Json -Compress -InputObject $payload) `
-Method Post `
-UseBasicParsing `
-Uri $webhook | Out-Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment