-
-
Save vexx32/1e5b1fa68510beda6002883bf401fdde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-TWAuthentication { | |
[CmdletBinding()] | |
param() | |
$bytes = [System.Text.Encoding]::ASCII.GetBytes('MyAPIKey') | |
$base64 = [System.Convert]::ToBase64String($bytes) | |
$basicAuthValue = "Basic $base64" | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -bor | |
[Net.SecurityProtocolType]::Tls11 -bor | |
[Net.SecurityProtocolType]::Tls | |
# Output final object | |
@{ Authorization = $basicAuthValue } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment