azure - 为什么我的 powershell DSC 失败并显示消息 "An item with the same key has already been added"

标签 azure powershell dsc

我们有一个正在执行的 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/

相关文章:

powershell - 在powershell中按CPU使用百分比列出进程

Terraform DSC 配置与节点配置中的 Azure 自动化

azure - Run.get_context() 给出相同的运行 ID

azure - Windows Azure 使用 A6 vmsize 部署云服务

powershell - 无法通过Powershell连接到live @ edu

powershell - 凭证和内部版本 10586 的 DSC 问题

powershell - 加密证书必须包含数据加密或 key 加密

azure - 尽管图像在 'watch' 中打开,但 Azure Blob 触发的 PIL UnidentifiedImageError

amazon-web-services - Azure 应用服务与 AWS SES 的通信

powershell - 选择对象 - 首先影响管道中的先前 cmdlet