powershell/PSDSCReturnCorrectTypesForDSCFunctions 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/PSDSCReturnCorrectTypesForDSCFunctions"] or by setting
rules.powershell.PSDSCReturnCorrectTypesForDSCFunctions.severity = "warning" in .tally.toml.Description
The functions in DSC resources have specific return objects. For non-class based resources:Set-TargetResourcemust not return any value.Test-TargetResourcemust return a boolean.Get-TargetResourcemust return a hash table.
Setmust not return any value.Testmust return a boolean.Getmust return an instance of the DSC class.