PowerShell Azure Cmd Not Recognized

Starting PowerShell ISE (V4), I install the AzureRM module as follows

Import-Module AzureRM 

Then I check the version

 (get-module azurerm).Version 

which returns

 Major Minor Build Revision 3 4 0 -1 

Then I try to use the login cmdlet

 Login-AzureRmAccount 

but get an error

 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 work for the proxy and used the following command to get around it

 [System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials 

I also installed the PSGallery repository as follows

 Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted 
+5
source share
2 answers

I upgraded to Windows Management Framework 5 and now I can run the Login-AzureRMAccount command

We can also download the Azure PowerShell installation file and install it. We can download the installation file for PS version 3.3.0 from this page:

https://github.com/Azure/azure-powershell/releases/tag/v3.3.0-December2016

+2
source

Login-AzureRmAccount is just an alias for Add-AzureRmAccount, which is used to access ARM resources in your Azure account.

Add-AzureAccount is used to access the "classic" resources in your Azure account.

+1
source

Source: https://habr.com/ru/post/1263913/


All Articles