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

Description

You can’t redefine common parameters in an advanced function. Using the CmdletBinding or Parameter attributes creates an advanced function. The common parameters are are automatically available in advanced functions, so you can’t redefine them.

How

Change the name of the parameter.

Examples

Problematic code

Correct code

Source

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