Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法识别PowerShell Azure Cmdlet_Powershell_Azure - Fatal编程技术网

无法识别PowerShell Azure Cmdlet

无法识别PowerShell Azure Cmdlet,powershell,azure,Powershell,Azure,运行PowerShell ISE(V4),我安装AzureRM模块如下 Import-Module AzureRM Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted 然后我检查版本 (get-module azurerm).Version 返回 Major Minor Build

运行PowerShell ISE(V4),我安装AzureRM模块如下

Import-Module AzureRM
Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted
然后我检查版本

(get-module azurerm).Version
返回

Major  Minor  Build  Revision
3      4      0      -1
然后,我尝试使用login cmdlet

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
    + FullyQualifiedErrorId : CommandNotFoundException
我做错了什么

注意 我在一个代理后面工作,并使用以下命令绕过它

[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
我还将PSGallery回购设置如下

Import-Module AzureRM
Register-PSRepository -Name "PSGallery" -SourceLocation "https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted

登录AzurerAccount只是Add AzurerAccount的别名,用于访问Azure帐户中的ARM资源

添加AzureAccount用于访问Azure帐户中的“经典”资源

我升级到Windows Management Framework 5,现在可以运行 命令登录AzureRMAccount

我们还可以下载Azure PowerShell安装文件并进行安装。 我们可以从此页面下载PS 3.3.0版安装文件:


尝试重新安装整个模块?现在,当尝试
安装模块AzureRm
时,我发现错误
未找到与指定搜索条件和模块名称AzureRm
匹配的项。类似将再次尝试安装
PowerShellGet
。否。windows8.1。我正在代理后工作-不确定这是否导致了我之前评论中的错误。虽然很奇怪,因为我可以列出所有Azure模块,但似乎无法使用它们。你从中得到了什么:get Module-ListAvailable-Name Azure-Refresh@juvchan:使用该命令时未显示任何内容。但是如果我使用
get Module-listavable-Name Azure*-Refresh
,我会得到一个很长的列表。我是否需要
安装模块Azure
以及
安装模块AzureRM
?我以为前者只适用于ASM。所以
添加AzureAccount
似乎起作用-窗口打开,供我添加凭据等。运行
获取AzureAccount
会显示我的帐户。但是,尝试使用像
New AzureRmResourceGroup…
这样的命令时,错误只是告诉我
运行登录AzureRmAccount
——当我尝试这样做时,我会得到与以前相同的错误,即
。。无法识别为cmdlet的名称…
。是否可以运行
添加AzurerAccount
?您无法运行
新建AzureRMResourceGroup
,因为您登录时只访问经典资源(
添加AzureAccount
)。这是有道理的,但仍然使用my quandry-无法使用
登录AzureRmAccount
,因为无法识别它,显然。您是否同时运行了
安装模块AzureRM
安装AzureRM
?第一个命令从PowerShell库安装AzureRM模块。第二个命令在AzureRM模块中指定的模块版本范围内安装Azure资源管理器的所有组件模块。链接:只是想看看提供的信息是否有用。如果您需要进一步的帮助,请告诉我。