I am getting the following error when trying to install Chocolatey through powershell on Windows:
Exception calling "DownloadString" with "1" argument(s): "Unable to connect to the remote server"
Using the equivalent command for the command line results in the same error
While trying to install Chocolatey through powershell with the following Powershell(PS) command found [here] (https://chocolatey.org/install):
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Even though I access this website in my browser the error above is received I tried using my default Credentials for powershell as mentioned here:
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
The same error is received. Which I assume means that my Default Credentials are not set as expected.
Here is where I am not sure how to set up the correct Default Credentials
**Other things I have tried: **
- Manually Run change my powershell credentials using the following guide: http://woshub.com/using-powershell-behind-a-proxy/
From this I ran the following commands in Powershell
$Wcl=New-Object System.Net.WebClient
$Creds=Get-Credential
$Wcl.Proxy.Credentials=$Creds
And then ran the the same command as above but with $Wcl as the Webclient object like so:
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials; iex ($Wcl.DownloadString('https://community.chocolatey.org/install.ps1'))
Powershell Version used for this issue: 5.1.19041.1682
Does anyone know what is being done wrong here?