Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 846 Bytes

ReservedParams.md

File metadata and controls

51 lines (40 loc) · 846 Bytes
description ms.date ms.topic title
Reserved Parameters
03/06/2024
reference
ReservedParams

ReservedParams

Severity Level: Error

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.

Example

Wrong

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

Correct

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