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
315315 # Disable Progress Bar in function scope during Invoke-WebRequest
316316 $ProgressPreference = ' SilentlyContinue'
317317
318- [Net.ServicePointManager ]::SecurityProtocol= [Net.SecurityProtocolType ]::Tls12
318+ if ($PSVersionTable.PSVersion -lt 7.0 .0 )
319+ {
320+ [Net.ServicePointManager ]::SecurityProtocol= [Net.SecurityProtocolType ]::Tls12
321+ }
319322
320323 $result = Invoke-WebRequest @params
321324
@@ -582,7 +585,10 @@ function Invoke-GHRestMethod
582585 }
583586 finally
584587 {
585- [Net.ServicePointManager ]::SecurityProtocol = $originalSecurityProtocol
588+ if ($PSVersionTable.PSVersion -lt 7.0 .0 )
589+ {
590+ [Net.ServicePointManager ]::SecurityProtocol = $originalSecurityProtocol
591+ }
586592 }
587593}
588594
You can’t perform that action at this time.
0 commit comments