Skip to main content
powershell/PSDSCUseIdenticalParametersForDSC 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/PSDSCUseIdenticalParametersForDSC"] or by setting rules.powershell.PSDSCUseIdenticalParametersForDSC.severity = "warning" in .tally.toml.

Description

The Get-TargetResource, Test-TargetResource and Set-TargetResource functions of DSC Resource must have the same parameters.

How

Correct the parameters for the functions in DSC resource.

Examples

Problematic code

Correct code

Source

This rule documentation is adapted from Microsoft’s PSScriptAnalyzer documentation for DSCUseIdenticalParametersForDSC, licensed under CC BY 4.0.