dlwyatt / PolicyFileEditor

PowerShell functions and DSC resource wrappers around the TJX.PolFileEditor.PolFile .NET class.
Apache License 2.0
190 stars 33 forks source link

Possible to add support for 'Comment' field? #18

Open cwegener opened 5 years ago

cwegener commented 5 years ago

I have just started using the PolicyFileEditor module for my DSC work and it does exactly what I need.

One feature that I would like to see is the ability to write into the 'Comment' area of each Administrative Setting. That way, I can leave some notes in a gpresult /H output file if anybody ever were to look at the Windows machine that was configured via DSC + PolicyFileEditor.

Is this possible to implement at all?

If so, how complex would this be to implement?

dlwyatt commented 3 years ago

Hmm, don't think those fields existed back when I wrote this. Not sure if those comments live in the same registry.pol file where the actual data is, or not.

Looks like Microsoft retired the technet gallery though, which is where I had published the C# code behind the dll that's in this project. I'll have to look around and see if I can find it again, before that sort of update could be made.

dlwyatt commented 3 years ago

Yup, that code may be lost forever :\ It's something I did back before I even knew what Git was, and since it was already publicly available on the MS script gallery, I never thought to publish it here as well.

It's not too hard to just decompile the DLL and reproduce the functionality (either in another C# class, or just in raw PowerShell), since it's .NET code, if someone wants to do that at some point.