Updating MULTI_SZ registry values using DSC

Tagged: , ,

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Mike Robertson Mike Robertson 2 months, 2 weeks ago.

  • Author
    Posts
  • #65767
    Profile photo of Mike Robertson
    Mike Robertson
    Participant

    I've successfully used DSC to apply registry changes with single values like DWORDS and strings. I flip the Force flag on, and it replaces whatever is there with the value I want.

    However, I have a project now that would require adding a value to a MULTI_SZ with existing values. I don't want to remove what's already there – just append an additional value. I haven't come across any examples where people have done anything similar, and I didn't find any logic to handle this in a cursory read of the registry resource code.

    Can the registry resource be used as-is to append values rather than replace, or do I need to just create some custom code in my script? I can do the latter easily enough, but I'd much prefer to keep my configuration code as clean as possible.

  • #65886
    Profile photo of Don Jones
    Don Jones
    Keymaster

    You'd have to do something custom – and I'd consider either extending the existing Registry resource (and submitting a pull request so Microsoft accepts your changes), or a new DSC resource entirely.

    • #65982
      Profile photo of Mike Robertson
      Mike Robertson
      Participant

      I've been wanting to contribute to a larger project, so I guess I just signed myself up for this one. Thank you!

You must be logged in to reply to this topic.