Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-DatumStructure JSON DefinitionFile broken #135

Open
schnyders opened this issue Aug 28, 2023 · 0 comments
Open

New-DatumStructure JSON DefinitionFile broken #135

schnyders opened this issue Aug 28, 2023 · 0 comments

Comments

@schnyders
Copy link

schnyders commented Aug 28, 2023

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant