Azure PowerShell will not connect

13,535

From the command prompt run:

powershell Set-ExecutionPolicy RemoteSigned
Share:
13,535
George Filippakos
Author by

George Filippakos

An accomplished developer with extensive experience developing high usage web applications for desktop and mobile.

Updated on June 09, 2022

Comments

  • George Filippakos
    George Filippakos almost 2 years

    I have downloaded and installed the Azure Powershell by following the MS instructions: https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/

    Using the Windows Powershell ISE I run the command:

    Login-AzureRmAccount

    which returns the the error:

    Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.Profile', but the  module could not be loaded. For more information, run 'Import-Module AzureRM.Profile'. At line:1 char:1
    + Login-AzureRmAccount
    + ~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
    

    Import-Module AzureRM.Profile

    Returns this error:

    Import-Module : File C:\Program Files (x86)\Microsoft 
    SDKs\Azure\PowerShell\ResourceManager\AzureResourceManager\AzureRM.Profile\CheckVersions.ps1 cannot be loaded 
    because running scripts is disabled on this system. For more information, see about_Execution_Policies at 
    http://go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + Import-Module AzureRM.Profile
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
    

    Why is it so difficult to connect to Azure, what could be wrong?