Home Dashboard Directory Help
Search

DSC Module - Mandatory Parameters in helper functions need a better error message by Tome Tanasovski


Status: 

Active


7
0
Sign in
to vote
Type: Suggestion
ID: 799974
Opened: 9/8/2013 1:47:14 PM
Access Restriction: Public
0
Workaround(s)
view

Description

If you are creating a custom DSC script provider and use a function with mandatory parameters outside of the core 3 functions: test-targetresource, set-targetresource, get-targetresource and you forget to supply those mandatory parameters, the error you receive is the following:

PowerShell Desired State Configuration does not support execution of commands in an interactive mode.
    + CategoryInfo         : OperationStopped: (:) [], CimException
    + FullyQualifiedErrorId : System.NotSupportedException
    + PSComputerName        : server2

It would be really helpful if the error told you that you forgot to specify a mandatory parameter
Details
Sign in to post a comment.
Posted by Aaron Jensen on 7/21/2014 at 10:55 AM
This can also happen if you've marked one of the parameters of your Get/Set/Test-TargetResource parameter as mandatory, but your configuration doesn't pass that value or passes it as `$null`. Only Key parameters should be marked as mandatory.
Sign in to post a workaround.