Wednesday, 30 September 2020

Connect-AzureAD : The term 'Connect-AzureAD' is not recognized

Working on Windows 10 2004 to execute powershell script and found that AzureAD module is not installed yet. 

Error Message: 

Connect-AzureAD : The term 'Connect-AzureAD' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Executed command Install-Module AzureAD to install the module from Administrator powershell windows, another error prompt as below:

Error Message:

Install-Module : The 'Install-Module' command was found in the module 'PowerShellGet', but the module could not be loaded. For more information, run 'Import-Module PowerShellGet'. 


Perform check on Powershell Execution Policy and currently on Restricted state. 

Execute Set-ExecutionPolicy Unrestricted to unblock it and it's work !


Finally, I was able to connect AzureAD to continue the work.