Skip to content

Files

Latest commit

 

History

History
43 lines (32 loc) · 668 Bytes

ReservedParams.md

File metadata and controls

43 lines (32 loc) · 668 Bytes

Pattern: Use of reserved common parameter

Issue: -

Description

You cannot use reserved common parameters in an advanced function.

How

Change the name of the parameter.

Example of incorrect code:

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

Example of correct code:

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

Further Reading