我需要在PowerShell中运行以下命令:
New-AzResourceGroupDeployment
-Name Myrg1010
-ResourceGroupName ADFcslResourceGroup
-TemplateFile C:\ADFARM.json
-TemplateParameterFile C:\ADFARM-Parameters.json
在运行此命令之前,我已连接到我的Azure订阅
Connect-AzAccount
但我有以下错误:
New-AzResourceGroupDeployment : The term 'New-AzResourceGroupDeployment' 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
+ New-AzResourceGroupDeployment -Name MyARMDeployment -ResourceGroupNam ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (New-
AzResourceGroupDeployment:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我找到了这个article,但这不是我的情况,因为我的powershell版本是5. 1. 2
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 5.1.2 Azure {Get-
AzureAutomationCertificate, Get-AzureAutomationConnection, New-AzureAuto...
请问我该怎么办?
3条答案
按热度按时间ubof19bj1#
您需要安装Azure Powershell模块:
您可以只查找此命令的一个:
或全部:
有关详细信息,请参阅here
niknxzdl2#
无论何时收到cmdlet错误,都需要检查模块是否已安装,如注解中所述,请尝试安装
Az Module
9rnv2umw3#
对我来说,在命令New-AzResourceGroup中有一个拼写错误,纠正它已经修复了。