Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt

Use this file to discover all available pages before exploring further.

powershell/PSReservedParams is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
PropertyValue
SeverityError
CategoryPSScriptAnalyzer
Auto-fixNo

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

function Test
{
    [CmdletBinding()]
    Param
    (
        $ErrorVariable,
        $Parameter2
    )
}

Correct code

function Test
{
    [CmdletBinding()]
    Param
    (
        $Err,
        $Parameter2
    )
}

Source

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