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

Description

Functions that support pipeline input should always handle parameter input in a process block. Unexpected behavior can result if input is handled directly in the body of a function where parameters declare pipeline support.

Examples

Problematic code

Result

Correct code

Result

Source

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