I have a CI/CD script which installs dotnet core using the scripts (https://dot.net/v1/dotnet-install.ps1). We download (and cache) the script, then want to invoke it directly from script using powershell
powershell -NoLogo -NonInteractive -NoProfile -ExecutionPolicy unrestricted -File "%MYDIR%\dotnet-install.ps1" -Version 2.1.806
However, on the CI/CD machine, this fails:
dotnet-install: Downloading link: https://dotnetcli.[snip]/dotnet-sdk-2.1.806-win-x86.zip
dotnet-install: Cannot download: https://dotnetcli.[snip]/dotnet-sdk-2.1.806-win-x86.zip
dotnet-install: Downloading legacy link: https://dotnetcli.[snip]/dotnet-dev-win-x86.2.1.806.zip
dotnet-install: Cannot download: https://dotnetcli.[snip]/dotnet-dev-win-x86.2.1.806.zip
Could not find/download: ".NET Core SDK" with version = 2.1.806
It turns out that this fails because we cannot establish a secure connection, and need to enable Tls1.2
How do I do modify my powershell command to do this?