$requiredTls='Tls12'
  $availableSslProtocols=[enum]::getnames([net.securityprotocoltype])
  if([Net.ServicePointManager]::SecurityProtocol -notin $requiredTls -and $requiredTls -in $availableSslProtocols){
      [Net.ServicePointManager]::SecurityProtocol=[Net.SecurityProtocolType]::$requiredTls
  }