Trying to Install-Module AzureAD but Get-PSRepository "WARNING: Unable to find module repositories."

Brass Contributor

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 Module for Windows PowerShell" as per However, on running Install-Module AzureAD I see "PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'AzureAD'. Try Get-PSRepository to see all available registered module repositories."


I can run Register-PSRepository -Default without issue but when I run Get-PSRepository I am faced with "WARNING: Unable to find module repositories."


I have been able to run update-help, so I assume I can get online ok.


Finally, I tried to Register-PSRepository -Name PSGallery -SourceLocation
-Proxy my.proxy.server but see the message, "Get-PSGalleryApiAvailability : PowerShell Gallery is currently unavailable.  Please try again later."


Can someone please advise what I need to do to be able to successfully Install-Module AzureAD?

22 Replies

@Reinier SPRUIJT 


For me, I eventually found that the Execution Policy was set to Restrict.  I changed this to Bypass (Set-ExecutionPolicy Bypass), then was able to see that the see the repository (Get-PSRepository).


Then I just had to trust the PSGallery (Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted).


After that, I had no further problems.


@arfmach This help me to resolve issue in installing VMware powercli module in a Windows Server 2016