File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -315,7 +315,10 @@ function Invoke-GHRestMethod
315
315
# Disable Progress Bar in function scope during Invoke-WebRequest
316
316
$ProgressPreference = ' SilentlyContinue'
317
317
318
- [Net.ServicePointManager ]::SecurityProtocol= [Net.SecurityProtocolType ]::Tls12
318
+ if ($PSVersionTable.PSVersion -lt 7.0 .0 )
319
+ {
320
+ [Net.ServicePointManager ]::SecurityProtocol= [Net.SecurityProtocolType ]::Tls12
321
+ }
319
322
320
323
$result = Invoke-WebRequest @params
321
324
@@ -582,7 +585,10 @@ function Invoke-GHRestMethod
582
585
}
583
586
finally
584
587
{
585
- [Net.ServicePointManager ]::SecurityProtocol = $originalSecurityProtocol
588
+ if ($PSVersionTable.PSVersion -lt 7.0 .0 )
589
+ {
590
+ [Net.ServicePointManager ]::SecurityProtocol = $originalSecurityProtocol
591
+ }
586
592
}
587
593
}
588
594
You can’t perform that action at this time.
0 commit comments