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
Aravind_Kalaiselvan
May 29, 2020Copper Contributor
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Using TLS1.2 connection resolved the problem for me. Try executing the above command before installation.
- ChrisB2020Sep 14, 2020Copper Contributor
Setting TLS1.2 connection resolved the problem for me. Thank you so much.
- farismalaebSep 15, 2020Steel ContributorYes, there is an article which talk about this issue.
https://www.powershellcenter.com/2020/08/27/powershell-fix-warning-unable-to-resolve-package-source-https-www-powershellgallery-com-api-v2/
I struggle with this issue and the error is miss-leading.
- arfmachJun 18, 2020Brass Contributor
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
- NCRUZ12590Sep 23, 2022Copper Contributor
Thanks. Your solution worked for me. arfmach
- akb1985Jun 16, 2021Brass ContributorWe noticed an issue while installing Microsoft 365 PowerShell modules on some of the servers in the environment. Get-PSRepository did not return any value on these servers. This solution helped to register repositories and then we could successfully install all Microsoft 365 PowerShell modules in the servers.
- tommuonJun 16, 2020Copper Contributor
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
This fixed it for me as well