Add Fun\Random/prompt question.ps1
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user