Skip to content

Commit 70ebd00

Browse files
authored
Merge pull request #1597 from justin-newman/master
Update for [System.Net.SecurityProtocolType] settings
2 parents bfbe4e4 + 0c66871 commit 70ebd00

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

step-templates/slack-send-notification-using-block-kit.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"Name": "Slack - Send Notification using Block Kit",
44
"Description": "Send a message notification to Slack using the Block Kit formatting. These messages will be limited to more basic formats (e.g., using functions and inputs probably won't work), but you still will be able to make much nicer looking messages this way with the ability to preview them using the [Block Kit Builder](https://app.slack.com/block-kit-builder).",
55
"ActionType": "Octopus.Script",
6-
"Version": 2,
6+
"Version": 3,
77
"CommunityActionTemplateId": null,
88
"Packages": [],
99
"Properties": {
1010
"Octopus.Action.Script.ScriptSource": "Inline",
1111
"Octopus.Action.Script.Syntax": "PowerShell",
12-
"Octopus.Action.Script.ScriptBody": "$payload = ($OctopusParameters['ssn_BlockObj'] | ConvertFrom-Json)\n$payload | Add-Member -MemberType NoteProperty -Name channel -Value $OctopusParameters['ssn_Channel']\n$payload | Add-Member -MemberType NoteProperty -Name username -Value $OctopusParameters['ssn_Username']\n$payload | Add-Member -MemberType NoteProperty -Name icon_url -Value $OctopusParameters['ssn_IconUrl']\n$payload | Add-Member -MemberType NoteProperty -Name link_names -Value \"true\"\n\ntry {\n\t[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12\n if ($PSVersionTable.PSVersion.Major -ge 6)\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl']\n }\n else\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl'] -UseBasicParsing\n }\n} catch {\n Write-Host \"An error occurred while attempting to send Slack notification\"\n Write-Host $_.Exception\n Write-Host $_\n throw\n}"
12+
"Octopus.Action.Script.ScriptBody": "$payload = ($OctopusParameters['ssn_BlockObj'] | ConvertFrom-Json)\n$payload | Add-Member -MemberType NoteProperty -Name channel -Value $OctopusParameters['ssn_Channel']\n$payload | Add-Member -MemberType NoteProperty -Name username -Value $OctopusParameters['ssn_Username']\n$payload | Add-Member -MemberType NoteProperty -Name icon_url -Value $OctopusParameters['ssn_IconUrl']\n$payload | Add-Member -MemberType NoteProperty -Name link_names -Value \"true\"\n\ntry {\n\t[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls13 -bor [System.Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls11\n if ($PSVersionTable.PSVersion.Major -ge 6)\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl']\n }\n else\n {\n Invoke-Restmethod -Method POST -Body ($payload | ConvertTo-Json -Depth 10) -Uri $OctopusParameters['ssn_HookUrl'] -UseBasicParsing\n }\n} catch {\n Write-Host \"An error occurred while attempting to send Slack notification\"\n Write-Host $_.Exception\n Write-Host $_\n throw\n}"
1313
},
1414
"Parameters": [
1515
{
@@ -65,10 +65,10 @@
6565
],
6666
"StepPackageId": "Octopus.Script",
6767
"$Meta": {
68-
"ExportedAt": "2023-06-02T20:17:55.244Z",
69-
"OctopusVersion": "2023.3.1205-hotfix.1753",
68+
"ExportedAt": "2025-25-03T10:29:69.420Z",
69+
"OctopusVersion": "2025.2.3087",
7070
"Type": "ActionTemplate"
7171
},
7272
"LastModifiedBy": "justin-newman",
7373
"Category": "slack"
74-
}
74+
}

0 commit comments

Comments
 (0)