diff --git "a/Fun\\Random/prompt question.ps1" "b/Fun\\Random/prompt question.ps1" new file mode 100644 index 0000000..3753720 --- /dev/null +++ "b/Fun\\Random/prompt question.ps1" @@ -0,0 +1,22 @@ +try { + $URL = "https://google.com" + $URL_Test = Invoke-WebRequest -UseBasicParsing $_URL | Select-Object -ExpandProperty StatusCode +} + +catch { + Write-Output "URL does accept current TLS settings:" + [Net.ServicePointManager]::SecurityProtocol + Write-Output "`n" + $Question = Read-host "Do you want to add TLS version 1.2 now? [y/n]" + switch ($Question.ToLower()) { + { @("y", "yes") -contains $_ } { + #Adds TLS version 1.2 for communication + [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 + } + default { + Write-Output "Please update TLS version, exiting script." + Start-Sleep 5 + Exit + } + } +} \ No newline at end of file