Commit 4423ee85 authored by mseng3's avatar mseng3
Browse files

Update post-to-slack.ps1

parent 061ebd11
...@@ -43,17 +43,6 @@ $body = ConvertTo-Json -Compress -InputObject $payload ...@@ -43,17 +43,6 @@ $body = ConvertTo-Json -Compress -InputObject $payload
Write-Output "body:" Write-Output "body:"
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.
# But the line below should force TLS v1.2 to be preferred.
# A better solution would be to change the system default TLS version to something higher than v1.1.
# https://api.slack.com/changelog/2019-07-deprecate-early-tls-versions
# https://www.reddit.com/r/PowerShell/comments/7zr0yu/invokewebrequest_windows_powershell_51_is_scaring/
# https://github.com/RamblingCookieMonster/PSSlack/blob/master/PSSlack/PSSlack.psm1
#[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
#[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
# Send REST call # Send REST call
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-5.1
Invoke-WebRequest -Body $body -UseBasicParsing -Method Post -Uri $webhook Invoke-WebRequest -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