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/PSAvoidMultipleTypeAttributes is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
| Property | Value |
|---|
| Severity | Warning |
| Category | PSScriptAnalyzer |
| Auto-fix | No |
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.
Examples
Problematic code
function Test-Script
{
[CmdletBinding()]
Param
(
[switch]
[int]
$Switch
)
}
Correct code
function Test-Script
{
[CmdletBinding()]
Param
(
[switch]
$Switch
)
}
Source
This rule documentation is adapted from Microsoft’s PSScriptAnalyzer documentation for
AvoidMultipleTypeAttributes,
licensed under CC BY 4.0.