Forum Discussion
Reinier SPRUIJT
Jun 11, 2018Brass Contributor
Trying to Install-Module AzureAD but Get-PSRepository "WARNING: Unable to find module repositories."
I am running PSVersion 5.1.16299.431 and have set my proxy using NetSH WinHTTP Set Proxy proxy-server="my.proxy.server" I would like to "Install the preview version of the Azure Active Directory ...
- Jun 18, 2020
I followed this article, and the "Microsoft way" didn't work. I needed to execute the second block of commands:
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 Register-PSRepository -Default -Verbose Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
Reinier SPRUIJT
Jul 03, 2018Brass Contributor
Thank you all for your help. Solution found!
https://blogs.technet.microsoft.com/keithmayer/2016/01/06/quick-tip-using-azure-powershell-with-web-proxy-and-fiddler/ at Step 2 (Optional) – Add Proxy Credentials to Script:
To use Windows credentials for proxy authentication, you can add …
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
...and when I added that in a new PowerShell session, Get-PSRepository shows the expected:
Name InstallationPolicy SourceLocation
---- ------------------ --------------
PSGallery Untrusted https://www.powershellgallery.com/api/v2/
...and Install-Module AzureADPreview works, so obviously a proxy issue all along.
- SnehaTrivediJul 13, 2020Copper Contributor
Reinier SPRUIJT Thank you for the solution. It helped me as well.
- HAciliMay 11, 2020Copper Contributor
Hello Reinier,Reinier SPRUIJT
I have the same problem, please could you share with me the solution.
thank youu.
cordially
- CJ_ChaconJan 23, 2019Copper ContributorAdded it to $profile and works like a charm! Thanks!