2017-04-03 90 views
0

我在我的Ubuntu機器中安裝了Powershell。當我進入到Login-AzureRmAccount PowerShell中,我得到如下錯誤:Ubuntu:無法將「Login-AzureRmAccount」識別爲cmdlet的名稱

PS> Login-AzureRmAccount                        
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 

當我進入Get-Module -ListAvailable -Name Azure -Refresh,我沒有得到任何結果。

PowerShell的版本:

powershell -version 
powershell v6.0.0-alpha.17 

如何解決上面的錯誤?

+0

您可以嘗試「Get-Module -ListAvailable」查看所有模塊,並查看是否可以使用azure。如果沒有,則不安裝。 – Aravind

+0

嗨,你的Ubuntu版本是什麼? Ubuntu 14.0.4或16? –

回答

3

您需要首先安裝在Azure PowerShell的模塊:

#Azure RM NetCore Preview Module Install 
powershell Install-Module AzureRM.NetCore.Preview 
powershell Import-Module AzureRM.NetCore.Preview 

這是我的測試。

[email protected]:/home# powershell 
PowerShell 
Copyright (C) 2016 Microsoft Corporation. All rights reserved. 

PS /home> Login-AzureRmAccount            
VERBOSE: To sign in, use a web browser to open the page https://aka.ms/devicelogin and enter the code F2RKUXRNE to authenticate. 

欲瞭解更多信息,請參閱此link

+0

現在有效。有什麼用途首先安裝PowerShell版本? – karan

+0

你是什麼意思? –

+0

爲什麼我需要執行「powershell安裝模塊AzureRM.NetCore.Preview」和「powershell導入模塊AzureRM.NetCore.Preview」? – karan

相關問題