I have read many forums and tried a lot of things, but I simply cannot add the PS gallery I am behind a corporate proxy, but I have setup my profile to use it. I'm trying to register the PS repository using these commands
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://myproxy:1234')
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true
Register-PSRepository -default -Proxy http://myproxy:123
Get-PSRepository
Get-PSRepository is always returning a warning WARNING: Unable to find module repositories
I am on windows Server 2012 R2. I have verified the proxy has internet access by downloading an external URL so its definitely not an issue with the proxy being incorrect
How can I register the PS Gallery? Its driving me insane!
Thanks PS: Powershell version
Name Value
---- -----
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
UPDATE
I found that our corporate proxy is blocking requests to powershellgallery, this would explain a good chunk of the issues I'm facing. The proxy allows other http traffic but somehow blocks powershellgallery. I'll get in touch with the networking team and update this thread once I find out more.