powershell/PSDSCUseIdenticalMandatoryParametersForDSC is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in
Dockerfiles.
tally disables this rule by default because Desired State Configuration resources are out
of scope for Dockerfile
RUN analysis. Re-enable it with
include = ["powershell/PSDSCUseIdenticalMandatoryParametersForDSC"] or by setting
rules.powershell.PSDSCUseIdenticalMandatoryParametersForDSC.severity = "warning" in .tally.toml.Description
For script-based DSC resources, if a property is declared with attributesKey or Required in a
MOF file, then it should be present as a mandatory parameter in the corresponding
Get-TargetResource, Set-TargetResource and Test-TargetResource functions.
How
Make sure all the properties withKey or Required attributes have equivalent mandatory
parameters in the Get/Set/Test functions.
Examples
Consider the followingmof file.