8

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?

Matt
  • 45,022
  • 8
  • 78
  • 119
George Filippakos
  • 16,359
  • 15
  • 81
  • 92
  • 1
    what is the current `executionpolicy` on your system? – Kiran Reddy Feb 04 '16 at 02:43
  • 1
    Possible duplicate of [PowerShell says "execution of scripts is disabled on this system."](http://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system) – Matt Feb 04 '16 at 03:04
  • Running scripts is disabled on your system. For more information, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170 – Greg D Feb 04 '16 at 04:41

1 Answers1

23

From the command prompt run:

powershell Set-ExecutionPolicy RemoteSigned
George Filippakos
  • 16,359
  • 15
  • 81
  • 92