如何在Azure Cloud Shell中安装所需状态配置(DSC)?

时间:2018-10-16 12:48:20

标签: azure dsc azure-cloud-shell

是否可以在Azure Cloud Shell中安装并使用所需状态配置(DSC),如果可以,如何安装?

在Azure Cloud Shell提示符下,如果我运行以下命令:

Start-DscConfiguration

返回以下错误:

Start-DscConfiguration : The term 'Start-DscConfiguration' 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
+ Start-DscConfiguration
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Start-DscConfiguration:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

1 个答案:

答案 0 :(得分:0)

您可以将DCS脚本放入Azure自动化以从Cloud Shell使用。

https://docs.microsoft.com/en-us/azure/automation/automation-dsc-getting-started

一旦在Azure自动化中,您可以使用以下方法从CloudShell启动:

https://docs.microsoft.com/en-us/powershell/module/servicemanagement/azure/start-azureautomationrunbook?view=azuresmps-4.0.0