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 (
18
18
[switch ]$Quiet
19
19
)
20
20
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
22
33
$LogPath = " $env: TEMP \Remotely_Install.txt"
23
34
24
35
[string ]$HostName = $null
41
52
}
42
53
43
54
$InstallPath = " $env: ProgramFiles \Remotely"
55
+ # endregion
44
56
57
+ # region Functions
45
58
function Write-Log ($Message ) {
46
59
if (! $Quiet ) {
47
60
Write-Host $Message
@@ -185,6 +198,10 @@ function Install-Remotely {
185
198
Start-Service - Name Remotely_Service
186
199
}
187
200
201
+ # endregion
202
+
203
+ # region Main
204
+
188
205
try {
189
206
Run- StartupChecks
190
207
@@ -205,6 +222,7 @@ try {
205
222
}
206
223
catch {
207
224
Write-Log - Message " Error occurred: $ ( $Error [0 ].InvocationInfo.PositionMessage) "
208
- throw $Error [0 ]
225
+ throw $Error [0 ]
209
226
Do - Exit
210
227
}
228
+ # endregion
You can’t perform that action at this time.
0 commit comments