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

M365DSC Export does not export config data in a portable way #14

Open
raandree opened this issue May 23, 2024 · 2 comments
Open

M365DSC Export does not export config data in a portable way #14

raandree opened this issue May 23, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@raandree
Copy link
Owner

M365DSC exports data as a .ps1 script. That does not scale and does not allow converting the data to JSON or YAML.

There is a promising MOF Parser but this parser cannot handle complex data types. An issue is open: KingslandConsulting/Kingsland.MofParser#83.

The most promising way is to rewrite the M365DSC export routing to get data and not PowerShell code.

@raandree raandree added the enhancement New feature or request label May 23, 2024
@ricmestre
Copy link

You can always use ConvertTo-DSCObject from DSCParser applied to the exported blueprint and then convert the object to JSON, there's also ConvertFrom-DSCObject that does the reverse.

@raandree
Copy link
Owner Author

raandree commented Sep 4, 2024

Thanks for he hint, @ricmestre. I have tried that with a very simple configuration generated with a Microsoft365DSC export. I have used this command:

ConvertTo-DSCObject -Path .\M365TenantConfig.ps1

The result was not very useful. Am I using the command in the wrong way?

InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.
InvalidOperation: Cannot index into a null array.

Name                           Value
----                           -----
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName
ResourceInstanceName
ResourceName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants