Closed agrecaBAS closed 3 years ago
This issue is resolved by adding the following to the script.
I am not having this issue. In case others do, where did you add the TLS version?
Thanks in advance.
Adding [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 before the invocation commands is what resolved the issue. In my case, I added it near or at the top of the script.
Thanks! That changes it for the session. On my development machine it's using TLS 1.2 by default. So my script doesn't need this. Though I did find the following bit of conditional code: `try { if ([Net.ServicePointManager]::SecurityProtocol -notcontains 'Tls12') {
}
}`
Mine returns SystemDefault
so this forces Tls12 even though it does not appear to need it. After running the code I get Tls12
.
Thank you for the clarification
Receiving the following error when attempting to run any command after populating the Auth information in a variable.
Example: $spanningAuth = Get-SpanningAuthentication -ApiToken $adminAPIToken -Region "US" -AdminEmail $AdminUsername Get-SpanningTenantInfo -AuthInfo $spanningAuth
Error: Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send. At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\SpanningO365\4.0.0.0\Private\Invoke-SpanningRequest.ps1:178 char:20 ... $results = Invoke-WebRequest -uri $request -Headers $headers -Method ...