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

Still struggling with Datum Handlers and variables in mof files #180

Closed
gabeKay opened this issue Jan 14, 2025 · 3 comments
Closed

Still struggling with Datum Handlers and variables in mof files #180

gabeKay opened this issue Jan 14, 2025 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@gabeKay
Copy link

gabeKay commented Jan 14, 2025

Hi again,

im still struggling with Datum Handlers and variables

The Datum module correctly processes variable substitution in the RSOP YAML output (e.g., [x={ $Node.NodeName}=] is correctly resolved to the actual node name), but fails to perform the same substitution when generating MOF files. While the DatumHandler successfully processes these variables during RSOP generation through ConvertTo-Datum, the same variables remain unresolved in the MOF generation process, resulting in literal strings instead of the resolved values in the final MOF files.

I tried a lot but its not eneugh.

Thanks for your help :)

gabeKay

@raandree raandree self-assigned this Jan 16, 2025
@raandree raandree added the question Further information is requested label Jan 16, 2025
@raandree
Copy link
Contributor

That is weird as the MOF files are generated from the RSOP data. We are getting the rsop data in CompileRootConfiguration.ps1 by calling Get-DatumRsopCache.

What do you get when calling Get-DatumRsopCache after the build finished? Do you get the data you expect or have the scriptblocks not resolved?

@gabeKay
Copy link
Author

gabeKay commented Jan 21, 2025

I actually built a Frankenstein :) The Infra Sample is too simple for my requirements, and the DSC Workshop is too much. So I broke everything down and overlooked the SamplerPipeline. I now need to integrate the CompileRootMeta or implement the DatumCache directly into the Root.

What you built is really complex but very good. However, I never found a proper guide. But I learned a lot from it :)

So basically, the ticket is done, as the issue is on my side. I just need to find time to implement it. During my research, I never came across the SamplerPipeline, crazy.

@raandree
Copy link
Contributor

The 'Infra Sample' is also pretty outdated. It was the DscWorkshop's predecessor.

Using the DscWorkshop as it is shouldn't be too much and too complex. It works out of the box and creates all required artifacts for all possible scenarios and the Common Tasks Library is a good start for most standard scenarios.

Maybe you can save yourself some time by implementing the DscWorkshop instead of tearing it apart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants