Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 690 Bytes

AvoidMultipleTypeAttributes.md

File metadata and controls

49 lines (39 loc) · 690 Bytes
description ms.date ms.topic title
Avoid multiple type specifiers on parameters.
06/28/2023
reference
AvoidMultipleTypeAttributes

AvoidMultipleTypeAttributes

Severity Level: Warning

Description

Parameters should not have more than one type specifier. Multiple type specifiers on parameters can cause runtime errors.

How

Ensure each parameter has only 1 type specifier.

Example

Wrong

function Test-Script
{
    [CmdletBinding()]
    Param
    (
        [switch]
        [int]
        $Switch
    )
}

Correct

function Test-Script
{
    [CmdletBinding()]
    Param
    (
        [switch]
        $Switch
    )
}