New-DatumStructure JSON DefinitionFile broken
A JSON that worked without any issue on version 0.39.0 doesn't work anymore in version 0.40.1
{
"ResolutionPrecedence": [
"AllNodes\\$($Node.NodeName)"
],
"DatumHandlersThrowOnError": true,
"DatumHandlers": {
"Datum.ProtectedData::ProtectedDatum": {
"CommandOptions": {
"PlainTextPassword": "SomeSecret"
}
},
"Datum.InvokeCommand::InvokeCommand": {
"SkipDuringLoad": true
}
}
}
This json for example doesn't work with 0.40.1, but it works with 0.39.0. If I convert this json to yml it works with both versions.
New-DatumStructure -DefinitionFile .\Datum.json returns
MetadataError: Cannot convert value "@{ResolutionPrecedence=System.Object[]; DatumHandlersThrowOnError=True; DatumHandlers=; __File=C:\tmp\DSCTest\Datum.json}" to type
"System.Collections.Hashtable". Error: "Cannot convert the "@{ResolutionPrecedence=System.Object[]; DatumHandlersThrowOnError=True; DatumHandlers=;
__File=C:\tmp\DSCTest\Datum.json}" value of type "System.Management.Automation.PSCustomObject" to type "System.Collections.Hashtable"."
InvalidOperation: You cannot call a method on a null-valued expression.
InvalidOperation: The property 'DatumDefinitionFile' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: You cannot call a method on a null-valued expression.
InvalidOperation: You cannot call a method on a null-valued expression.
Hi @schnyders, I have just came across this issue when searching for DatumHandlersThrowOnError. Did you ever solve it?
Hi @raandree
In our internal pipeline, I simply added a task to convert all json to yaml before using datum on it. But I also fixed it in a simple test env with this: https://github.com/gaelcolas/datum/pull/149
But it looks like first other things needs to be fixed. So that build checks work again.