DSC Custom Resource Oddity

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

This topic contains 1 reply, has 1 voice, and was last updated by

 
Participant
1 week, 4 days ago.

  • Author
    Posts
  • #181920

    Participant
    Topics: 4
    Replies: 6
    Points: 31
    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: 4
    Replies: 6
    Points: 31
    Rank: Member

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

The topic ‘DSC Custom Resource Oddity’ is closed to new replies.