Commit e1d28899 authored by mseng3's avatar mseng3
Browse files

Update post-to-slack.ps1

parent 8ba40bff
......@@ -39,6 +39,10 @@ if($icon -ne "No icon given") {
Write-Output "payload:"
Write-Output "$payload"
$body = ConvertTo-Json -Compress -InputObject $payload
Write-Output "body:"
Write-Output "$body"
# 2020-05-23: As of 2020-05-04, Slack is blocking TLS connections using TLS v1.1 or lower.
# This was causing Invoke-WebRequest to error out with a 404 / WebCmdletWebResponseException error.
# This may only affect systems with certain version of .NET (which is what Invoke-WebRequest relies on under the hood), due to it affecting the system's default TLS version.
......@@ -55,7 +59,7 @@ Write-Output "$payload"
#Invoke-WebRequest -Body (ConvertTo-Json -Compress -InputObject $payload) -UseBasicParsing -Method Post -Uri $webhook
Invoke-WebRequest `
-Body (ConvertTo-Json -Compress -InputObject $payload) `
-Body $body `
-UseBasicParsing `
-Method Post `
-Uri $webhook
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment