File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,18 @@ param (
1818 [switch ]$Quiet
1919)
2020
21- [System.Net.ServicePointManager ]::SecurityProtocol = [System.Net.SecurityProtocolType ]::Tls12
21+ # region Set SecurityProtocol
22+ # This will include all security protocols greater than or equal to TLS 1.2.
23+ [System.Net.SecurityProtocolType ]$SecurityProtocols = 0 ;
24+ [System.Enum ]::GetValues([System.Net.SecurityProtocolType ]) | Where-Object {
25+ $_ -ge [System.Net.SecurityProtocolType ]::Tls12
26+ } | ForEach-Object {
27+ $SecurityProtocols = $SecurityProtocols -bor $_
28+ }
29+ [System.Net.ServicePointManager ]::SecurityProtocol = $SecurityProtocols
30+ # endregion
31+
32+ # region Set Variables
2233$LogPath = " $env: TEMP \Remotely_Install.txt"
2334
2435[string ]$HostName = $null
4152}
4253
4354$InstallPath = " $env: ProgramFiles \Remotely"
55+ # endregion
4456
57+ # region Functions
4558function Write-Log ($Message ) {
4659 if (! $Quiet ) {
4760 Write-Host $Message
@@ -185,6 +198,10 @@ function Install-Remotely {
185198 Start-Service - Name Remotely_Service
186199}
187200
201+ # endregion
202+
203+ # region Main
204+
188205try {
189206 Run- StartupChecks
190207
@@ -205,6 +222,7 @@ try {
205222}
206223catch {
207224 Write-Log - Message " Error occurred: $ ( $Error [0 ].InvocationInfo.PositionMessage) "
208- throw $Error [0 ]
225+ throw $Error [0 ]
209226 Do - Exit
210227}
228+ # endregion
You can’t perform that action at this time.
0 commit comments