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

Description

All DSC resources are required to implement the correct functions. For non-class-based resources:
  • Set-TargetResource
  • Test-TargetResource
  • Get-TargetResource
For class-based resources:
  • Set
  • Test
  • Get

How

Add the missing functions to the resource.

Example 1

Problematic code

Correct code

Example 2

Problematic code

Correct code

Source

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