[英]PowerShell Azure Cmdlet not Recognized
Running PowerShell ISE (V4), I install the AzureRM module as follows 运行PowerShell ISE(V4),我按如下方式安装AzureRM模块
Import-Module AzureRM
I then check the version 然后我查看版本
(get-module azurerm).Version
which returns 返回
Major Minor Build Revision
3 4 0 -1
I then attempt to use the login cmdlet 然后我尝试使用登录cmdlet
Login-AzureRmAccount
but get the 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'm working behind a proxy and have used the following command to get round it 注意我在代理后面工作,并使用以下命令来绕过它
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
I've also set the PSGallery repo as follows 我还设置了PSGallery回购如下
Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted
I upgraded to Windows Management Framework 5 and I can now run the command Login-AzureRMAccount
我升级到Windows Management Framework 5,现在我可以运行命令Login-AzureRMAccount
Also we can download the Azure PowerShell installation file and install it. 我们还可以下载Azure PowerShell安装文件并进行安装。 We can download the PS version 3.3.0 installation file from this page:
我们可以从这个页面下载PS版本3.3.0安装文件:
https://github.com/Azure/azure-powershell/releases/tag/v3.3.0-December2016 https://github.com/Azure/azure-powershell/releases/tag/v3.3.0-December2016
Login-AzureRmAccount is simply an alias for Add-AzureRmAccount which is used to access the ARM resources in your Azure account. Login-AzureRmAccount只是Add-AzureRmAccount的别名,用于访问Azure帐户中的ARM资源。
Add-AzureAccount is used to access the "classic" resources in your Azure account. Add-AzureAccount用于访问Azure帐户中的“经典”资源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.