Forum Discussion
Trying to Install-Module AzureAD but Get-PSRepository "WARNING: Unable to find module repositories."
- 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
Please try to install the latest PowershellGet module as described here https://www.powershellgallery.com/packages/PowerShellGet/1.6.5 and try you actions again.
You can try both Azure Ad versions
Install-Module AzureAD or Install-Module AzureADPreview
Maluks, thank you for the suggestion. When I run Get-Module -Name PowerShellGet -ListAvailable | Select-Object -Property Name,Version,Path it results in the following output:
Name Version Path
---- ------- ----
PowerShellGet 1.0.0.1 C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PowerShellGet.psd1
However, when I then run Install-Module PowerShellGet -Force I get the output:
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'PowerShellGet'. Try Get-PSRepository to see all available registered module repositories.
Also, when I run Save-Module -Name PowerShellGet -Path "c:\mydir" I get output:
PackageManagement\Save-Package : No match was found for the specified search criteria and module name 'PowerShellGet'. Try Get-PSRepository to see all available registered module repositories.
Any other way to Install-Module AzureAD you can suggest?
- Thomas LeeJun 20, 2018Copper Contributor
Have you tried:
Get-Module -Name PowerShellGet -ListAvailable | Install-Module
- Reinier SPRUIJTJun 22, 2018Copper Contributor
Thank you for the tip Thomas Lee, when I run Get-Module -Name PowerShellGet -ListAvailable | Install-Module I get output:
PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'PowerShellGet'. Try Get-PSRepository to see all available registered module repositories.
Is this expected given that the get-module -ListAvailable match for PowerShellGet did list a path in C:\Program Files\WindowsPowerShell? Also, it part of the issue that get-module and get-psrepository don't have parameters to set a proxy? As I mentioned before, I did have set my proxy using NetSH WinHTTP Set Proxy proxy-server="my.proxy.server".
I'm running out of options running with this network configuration, as the proxy seems to be the issue. I have managed to install the module on another device outside the network.
- Thomas LeeJun 22, 2018Copper Contributor
Whoops - my bad - a typo in my suggestion.
Instead of Get-Module -list, it should have been Find-Module PowerShellGet | Install-module