Trying to Install-Module AzureADPreview but Get-PSRepository “WARNING: Unable to find module repositories.”
If you want to restrict the creation of groups for your organization you will need to run a number of PowerShell scripts. In these scripts you use the new AzureADPreview module.
Only during the installation something goes wrong because this module cannot be found in the PowerShell repository. How can you solve this?
In fact there is one golden solution here, namely to adjust your TLS settings, execute the following command and you will notice that the module can be installed correctly.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
After that it is best to run the following command, this command ensures that if you already have an earlier version of AzureAD commands installed they will not be impacted and the new module will be installed as a new “shell” on your system.
Install-Module AzureADPreview -Force -AllowClobber
Conclusion:
After a very simple fix you can install the AzureADPreview module and continue working on your project in combination with Azure AD.
Links: