Question:
Running PowerShell ISE (V4), I install the AzureRM module as follows
1 2 |
Import-Module AzureRM |
I then check the version
1 2 |
(get-module azurerm).Version |
which returns
1 2 3 |
Major Minor Build Revision 3 4 0 -1 |
I then attempt to use the login cmdlet
1 2 |
Login-AzureRmAccount |
but get the error
1 2 3 4 5 6 7 8 |
Login-AzureRmAccount : The term 'Login-AzureRmAccount' 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. At line:1 char:1 + Login-AzureRmAccount + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException |
What am I doing wrong?
NOTE
I’m working behind a proxy and have used the following command to get round it
1 2 |
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials |
I’ve also set the PSGallery repo as follows
1 2 |
Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted |
Answer:
I upgraded to Windows Management Framework 5 and I can now run the
command Login-AzureRMAccount
Also we can download the Azure PowerShell installation file and install it.
We can download the PS version 3.3.0 installation file from this page:
https://github.com/Azure/azure-powershell/releases/tag/v3.3.0-December2016