我们有一个正在执行的 powershell DSC,以使 vmss 达到所需的状态。 它一直有效,直到我们添加了更多参数,然后它就崩溃了。
我从脚本中删除了除参数之外的所有内容,但它仍然不起作用。 完整的错误是
The DSC Extension received an incorrect input: An error occurred while executing script or module 'IISInstall.ps1': An item with the same key has already been added..
Please correct the input and retry executing the extension.
我们甚至在 DSC 中添加了日志记录以尝试排除故障。 它似乎甚至没有进入 DSC 的机身。
我做错了什么?
最佳答案
该参数名为 $instanceName。我们希望使用它向 IIS 添加自定义 header ,以跟踪响应来自哪个实例。
事实证明,如果您使用 $instanceName 以某种方式介入 DSC 的内部,它永远不会正确部署!
一旦您从参数列表中删除 $instanceName,它就会起作用。
关于azure - 为什么我的 powershell DSC 失败并显示消息 "An item with the same key has already been added",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56369765/