From df041192172f9ad0a3ea9b4136f6418882cea27f Mon Sep 17 00:00:00 2001 From: Gabe Date: Sat, 16 May 2026 02:51:05 +0000 Subject: [PATCH] Add Fun\Random/prompt question.ps1 --- "Fun\\Random/prompt question.ps1" | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 "Fun\\Random/prompt question.ps1" 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