Skip to main content
powershell/PSAvoidNullOrEmptyHelpMessageAttribute is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
tally disables this rule by default for Dockerfile RUN snippets because a RUN executes statements inline rather than defining cmdlets, parameters, or modules with external callers. Re-enable it with include = ["powershell/PSAvoidNullOrEmptyHelpMessageAttribute"] or by setting rules.powershell.PSAvoidNullOrEmptyHelpMessageAttribute.severity = "warning" in .tally.toml.

Description

The value of the HelpMessage attribute should not be an empty string or a null value as this causes PowerShell’s interpreter to throw an error when executing the function or cmdlet.

How

Specify a value for the HelpMessage attribute.

Examples

Problematic code

Correct code

Source

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