📎 AI Summary:
The user is seeking help to authenticate through a proxy when using package managers like npm and Chocolatey in PowerShell or cmd, as they are experiencing connection errors despite having proxy credentials. Neemobeer suggests configuring proxy credentials in PowerShell by adding specific lines to the profile to establish authentication, especially if using Integrated Windows Authentication (IWA). The overall sentiment is collaborative, with a helpful troubleshooting tip provided to resolve proxy credential issues in PowerShell.

LucasCardim

New Member
Joined
Sep 29, 2022
Messages
1
Thread Author #1
Hello everyone! I really need help here. I work at a government company and need to connect with a proxy. On browsers there is no problem, but when i need to install something with npm or choco i cant do it via powershell or cmd as administrator. I have my credentials and the proxy ip and port. But in terminal i cant authenticate and always have an connection error trying to install things via npm or choco. What i have to do to authenticate on the proxy this way?
 

Solution
In PowerShell you can add this to your ps profile so it's set everything PowerShell runs.

Code:
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy()
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

This should work if it's IWA in use.

If the proxy is in-line then I believe you only need the second line.

Neemobeer

Windows Forum Team
Staff member
Joined
Jul 4, 2015
Messages
8,995
In PowerShell you can add this to your ps profile so it's set everything PowerShell runs.

Code:
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy()
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

This should work if it's IWA in use.

If the proxy is in-line then I believe you only need the second line.
 

Solution