A
A
Alexey K2020-05-22 13:41:41
PowerShell
Alexey K, 2020-05-22 13:41:41

How to download a file from HTTPS using PowerShell?

To download a file in PowerShell, use the command

powershell -command "& { Invoke-WebRequest 'http://eternallybored.org/misc/wget/1.20.3/32/wget.exe' -OutFile 'wget.exe' }"

It stopped working and started giving an error:
"Invoke-WebRequest : Запрос был прерван: Не удалось создать защищенный канал SSL/TLS."

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey K, 2020-05-22
@alexsupra

echo [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls" >getwget.ps1
echo Invoke-WebRequest 'http://eternallybored.org/misc/wget/1.20.3/32/wget.exe' -OutFile 'wget.exe' >>getwget.ps1
powershell -ExecutionPolicy Bypass -File getwget.ps1
del /f /q getwget.ps1 >nul

A
azarij, 2020-05-22
@azarij

https://www.google.com/search?q=Invoke-WebRequest+...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question