Open
Description
Summary of the new feature / enhancement
In order to avoid errors at runtime, the dsc config validate should detect and provide appropriate error response when a resource name is duplicated in a configuration document.
Configuration:
{
"$schema": "https://aka.ms/dsc/schemas/v3/bundled/config/document.json",
"resources": [
{
"type": "Microsoft.Windows/Registry",
"name": "EnsureTest1Value",
"properties": {
"keyPath": "HKEY_LOCAL_MACHINE\SOFTWARE\TEST",
"valueName": "Test1",
"valueData": { "DWord": 1 },
"_exist": true
}
},
{
"type": "Microsoft.Windows/Registry",
"name": "EnsureTest2Value",
"properties": {
"keyPath": "HKEY_LOCAL_MACHINE\SOFTWARE\TEST",
"valueName": "Test2",
"valueData": { "String": "Hello World!" },
"_exist": true
}
},
{
"type": "Microsoft.Windows/Registry",
"name": "EnsureTest1Value",
"properties": {
"keyPath": "HKEY_LOCAL_MACHINE\SOFTWARE\TEST",
"valueName": "Test",
"valueData": { "String": "Hello World!" },
"_exist": false
}
}
]
}
This below should return false with a reason as duplicate resource name
dsc config validate --file C:\dsc\Demo1.json
valid: true
reason: null
Proposed technical implementation details (optional)
No response