我正在尝试从azure自动化运行脚本Inrug Invoke-AzureRmVMRunCommand,但是它显示cmdlet不存在。请让我知道如何执行此操作。
Invoke-AzureRMVMRunCommand -ResourceGroup 'XXXXXX' -Name XXXXX-CommandID 'RunPowerShellScript' -ScriptPath 'Test.ps1'
Invoke-AzureRMVMRunCommand : The term 'Invoke-AzureRMVMRunCommand' 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
+ Invoke-AzureRMVMRunCommand -ResourceGroup 'olf3em-rds-mgmt' -Name OLF ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-AzureRMVMRunCommand:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
答案 0 :(得分:0)
您需要先安装模块,然后再使用这些模块:
简而言之:
转到模块
浏览图库
安装
答案 1 :(得分:0)
AzureRM.Compute模块中包含Invoke-AzureRmVMRunCommand命令。首先需要在自动化帐户中进行安装。