Created
March 24, 2020 20:41
-
-
Save HawaiiRyan/a04c2c09ed03114dbe2640d381a73e0a to your computer and use it in GitHub Desktop.
example-MoreSecure
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
###Force commuincation to only occur with TLS 1.2 | |
Write-Verbose -Message "Forcing TLS 1.2 Cipher...." | |
[Net.ServicePointManager]::SecurityProtocol = | |
[Net.SecurityProtocolType]::Tls12 | |
Write-Verbose -Message "TLS 1.2 Ciper Successfully Enforced" | |
$filepath = Get-Location | |
$WS1Env = Get-Content -Path $filepath\tools\config.ini | Select -Skip 1 | ConvertFrom-StringData | |
$logPath = $WS1Env.logpath | |
Write-Verbose -Message "Verifying $logPath folder exists..." | |
If(!(test-path $logPath)) | |
{ | |
Write-verbose -Message "Creating $logPath..." | |
New-Item -ItemType Directory -Force -Path $logPath -EA Continue | |
} | |
Write-Verbose -Message "$logPath exists, proceeding to set variables" | |
$addy = $WS1Env.UATEnvironment | |
$b64 = $WS1Env.UATb64 | |
$encodedString = "Basic " + $b64 | |
$apiKey = $WS1Env.UATapikey | |
$useJSON = "application/json" | |
$headers = @{"Authorization" = $encodedString; "aw-tenant-code" = $apiKey; "Accept" = $useJSON; "Content-Type" = $useJSON} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment