2

我的 Azure 自动化帐户上有以下工作流脚本作为 Runbook:

workflow Configure-VM
{
    $DSCConfigPath = "C:\DSCConfigs\TestConfiguration"
    inlinescript
    {
        Import-Module PSDesiredStateConfiguration
        Configuration TestConfiguration
        {
            Node "ak-testvm-001" {
                WindowsFeature IIS {
                    Ensure = "Present"
                    Name = "Web-Server"
                }
            }
        }

        Write-Output "INFO: Creating the DSC Configuration"
        TestConfiguration -NodeName "ak-testvm-001" -OutputPath $Using:DSCConfigPath

        Write-Output "INFO: Deploying DSC Configuration"
        Start-DscConfiguration -Path $Using:DSCConfigPath -Force -Wait -Verbose
        Write-Output "INFO: DSC Configuration Finished"

        Write-Output "INFO: END OF RUNBOOK"
    }
}

运行此 RunBook 时出现以下错误:

Import-Module: The specified module 'PSDesiredStateConfiguration' was not loaded because it was not found in any module directory.

如何从 Azure Runbooks 运行 DSC 配置?甚至有可能还是我绝对需要使用 Windows PowerShell?

4

1 回答 1

0

PowerShell 所需状态配置支持已在 5 月的有限预览中添加到 Azure 自动化。您可以在此处阅读有关如何使用 Azure 自动化管理 DSC 节点的更多信息。

于 2015-06-15T18:34:00.417 回答