【问题标题】:Issue with DSC ScriptDSC 脚本问题
【发布时间】:2018-09-21 01:15:28
【问题描述】:

只是尝试创建一个脚本来安装 IIS 和管理工具并收到以下错误,知道可能是什么原因吗?

Configuration iis_dsc_file
{
# Import the module that contains the resource we are using.

Import-DSCResource -ModuleName PsDesiredStateConfiguration
Import-module servermanager
# The Node statement specifices which targets this configuration will be applied to.
Node localhost
  {
  # Code to ensure IIS feature is enabled
  WindowsFeature WebServer
    {
    Ensure= "Present"
    Name= "Web-Server"
    }

  WindowsFeatures IISManagementTools {
    Name= "Web-Mgmt-Tools"
    Ensure= "Present"
    IncldueAllSubFeature= $True
    LogPath= "C:\ServerLogs\IIS-Installation-Log.txt"
    }
  }
}

我得到的错误信息如下:

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The term 'WindowsFeatures' 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.

知道是什么问题吗?

【问题讨论】:

    标签: azure azure-devops dsc


    【解决方案1】:

    失败是因为第二个 WindowsFeature 末尾有一个额外的 S

    顺便说一句,IncldueAllSubFeature 也拼错了,应该是 IncludeAllSubFeature

    【讨论】:

    • 周一试试,给你反馈。
    • 很好,现在很好用。谢谢您的帮助。我可以知道学习 PowerShell DSC for Azure Automation 的好地方/网站/网址在哪里吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-06
    • 1970-01-01
    相关资源
    最近更新 更多