我的Azure自动化帐户上有以下Workflow脚本作为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 Runbook运行DSC配置?它是否可能,或者我是否绝对需要使用Windows PowerShell?