【发布时间】:2019-09-23 12:36:24
【问题描述】:
在 IIS 的 DSC 配置脚本中,我试图从 httpErrors 部分删除 defaultPath 锁,但功能委派的工作方式不适用于此部分。因此要做到以下几点:
appcmd set config /section:httpErrors /lockAttributes:
我尝试使用 xWebConfigProperty,如下所示:
xWebConfigProperty httpErrors_lockAttributes
{
WebsitePath = "MACHINE/WEBROOT/APPHOST"
Filter = "system.webServer/httpErrors"
PropertyName = "lockAttributes"
Value = ""
Ensure = "Absent"
}
但是,这会失败并显示 lockAttributes 属性不存在的错误。然而它肯定在 ApplicationHost.config 中
我唯一剩下的解决方法是在 DSC 中将 appcmd 作为脚本运行(有点难看)。有什么想法吗?
【问题讨论】:
标签: powershell iis dsc