Private/Get-AuthHeader.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
function Get-AuthHeader { param($Token) # Decrypt the token if it is of type SecureString if ($Token.GetType().Name -eq 'SecureString') { $Token = [System.Runtime.InteropServices.marshal]::PtrToStringAuto([System.Runtime.InteropServices.marshal]::SecureStringToBSTR($Token)) } @{ 'x-api-key' = "$Token" 'Content-Type' = 'application/json; charset=utf-8' } } |