在 JSON DSC 中找不到 AdminCreds 参数
AdminCreds parameter not found in JSON DSC
我正在尝试向 azure arm 模板添加扩展,因此当它循环时,它会向每个虚拟机添加扩展,但我收到一个无法识别凭据参数的错误。
完整的JSON在下面的link:
https://pastebin.com/embed_iframe/7uvwdZ6e
我得到的错误是:
VM has reported a failure when processing extension 'CreateADPDC'. Error message: "The DSC Extension received an incorrect input: A parameter cannot be found that
matches parameter name 'AdminCreds'.
Another common error is to specify parameters of type PSCredential without an explicit type. Please be sure to use a typed parameter in DSC Configuration, for example:
configuration Example {
param([PSCredential] $UserAccount)
知道我哪里做错了吗?
提前致谢:)
此错误来自您的 configuration\arm 模板交互,如果您在那里有 AdminCreds 凭据参数,我认为您需要使用 protectedsettings 来传递它:
"protectedSettings": {
"configurationArguments": {
"adminCreds": {
"userName": "xxx",
"password": "yyy"
}
}
}
配置应如下所示(因此应包含具有该特定类型的 adminCreds 输入参数):
Param (
[System.Management.Automation.PSCredential]$Admincreds,
other_params
)
我正在尝试向 azure arm 模板添加扩展,因此当它循环时,它会向每个虚拟机添加扩展,但我收到一个无法识别凭据参数的错误。
完整的JSON在下面的link:
https://pastebin.com/embed_iframe/7uvwdZ6e
我得到的错误是:
VM has reported a failure when processing extension 'CreateADPDC'. Error message: "The DSC Extension received an incorrect input: A parameter cannot be found that
matches parameter name 'AdminCreds'.
Another common error is to specify parameters of type PSCredential without an explicit type. Please be sure to use a typed parameter in DSC Configuration, for example:
configuration Example {
param([PSCredential] $UserAccount)
知道我哪里做错了吗?
提前致谢:)
此错误来自您的 configuration\arm 模板交互,如果您在那里有 AdminCreds 凭据参数,我认为您需要使用 protectedsettings 来传递它:
"protectedSettings": {
"configurationArguments": {
"adminCreds": {
"userName": "xxx",
"password": "yyy"
}
}
}
配置应如下所示(因此应包含具有该特定类型的 adminCreds 输入参数):
Param (
[System.Management.Automation.PSCredential]$Admincreds,
other_params
)