DSC Custom Resource Oddity

Welcome Forums DSC (Desired State Configuration) DSC Custom Resource Oddity

Viewing 1 reply thread
  • Author
    Posts
    • #181920
      Participant
      Topics: 5
      Replies: 7
      Points: 42
      Rank: Member

      Very confusing ….  I’ve been using a pretty basic PowerShell DSC custom resource that deals with windows features.  It’s been working as expected for quite some time now, I thought, but I ran across some machines that appear to have an issue with the key.

      When I use nullable[string] as the type, it works for almost all machines, but some throw a “Value cannot be null” error when attempting to import the resource.  Removing “nullable” from the property type and leaving just as a string fixes the issue.  These are all Server 2016,  PS v5.1.14393.3053, .NET 4.6.01586, installed windows updates all are identical.

      [DscProperty(NotConfigurable)]
      [Nullable[string]]$windowsFeatureState

    • #181941
      Participant
      Topics: 5
      Replies: 7
      Points: 42
      Rank: Member

      Meh, I just removed the nullable part b/c I didn’t really need it.  🙂

Viewing 1 reply thread
  • The topic ‘DSC Custom Resource Oddity’ is closed to new replies.