DSC having trouble parsing registry key with a colon in it

Welcome Forums DSC (Desired State Configuration) DSC having trouble parsing registry key with a colon in it

Viewing 2 reply threads
  • Author
    Posts
    • #270089
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Hi,

      It seems that the registry DSC resource is having trouble when the registry key has the colon (“:”) and “{” “}” characters.
      The error for the code below is:

      PowerShell DSC resource MSFT_RegistryResource failed to execute Test-TargetResource functionality with error message: (ERROR) Invalid PSDrive
      ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MMC\SnapIns\FX’ specified in registry key
      ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MMC\SnapIns\FX:{4bbd4ebc-d808-4efc-b0a6-83c62e4ac931}’

      • This topic was modified 3 weeks, 3 days ago by kvprasoon. Reason: Code formatting
    • #270104
      Senior Moderator
      Topics: 9
      Replies: 1422
      Points: 5,289
      Helping Hand
      Rank: Community MVP

      Looks like a bug in Registry DSC provider. It tries to convert HKEY_LOCAL_MACHINE to HKLM: and the logic is based on ‘:’, since it already has ‘:’ in the path it skips that conversion.

      You can use HKLM: instead if HKEY_LOCAL_MACHINE to solve the problem.



      @gaelcolas
      , correct me if I’m wrong.

    • #270152
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Hi,

      Thanks for the quick response.
      Unfortunately, your suggestion did not fix the issue.
      For now, I am using a simpler registry key.
      Thanks again sir!

Viewing 2 reply threads
  • You must be logged in to reply to this topic.