Answer the question
In order to leave comments, you need to log in
Why is the script on the server throwing an error?
Win Server 2016.
In the PowerShell terminal I do:
powershell -Command "(new-object net.webclient).DownloadString('https://api.telegram.org/bot9872429879724:sdfsfdsfedfgdfgrfeve/sendMessage?chat_id=mydididididid&text=mytext')"
Исключение при вызове "DownloadString" с "1" аргументами: "Запрос был прерван: Не удалось создать защищенный канал SSL/TLS."
строка:1 знак:1
+ (new-object net.webclient).DownloadString('https://api.telegram.org/b ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException
Answer the question
In order to leave comments, you need to log in
try like this:
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object net.webclient).DownloadString('https://api.telegram.org/bot9872429879724:sdfsfdsfedfgdfgrfeve/sendMessage?chat_id=mydididididid&text=mytext')"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question