Skip to content

AvoidUsingPositionalParameters does not seem to be triggered #863

Closed
@LaurentDardenne

Description

@LaurentDardenne
cd c:\temp
Invoke-ScriptAnalyzer -ScriptDefinition "Write-host 'Get-ChildItem  *.txt'"
#ok one error

Invoke-ScriptAnalyzer -ScriptDefinition "Get-ChildItem  *.txt" -verbose
#nothing

VERBOSE: Cannot find a settings file.
VERBOSE: Analyzing Script Definition.
VERBOSE: Running PSAvoidUsingCmdletAliases rule.
VERBOSE: Running PSAvoidDefaultValueSwitchParameter rule.
VERBOSE: Running PSAvoidUsingEmptyCatchBlock rule.
VERBOSE: Running PSAvoidGlobalAliases rule.
VERBOSE: Running PSAvoidGlobalFunctions rule.
VERBOSE: Running PSAvoidDefaultValueForMandatoryParameter rule.
VERBOSE: Running PSAvoidGlobalVars rule.
VERBOSE: Running PSAvoidInvokingEmptyMembers rule.
VERBOSE: Running PSAvoidNullOrEmptyHelpMessageAttribute rule.
VERBOSE: Running PSReservedCmdletChar rule.
VERBOSE: Running PSReservedParams rule.
VERBOSE: Running PSAvoidShouldContinueWithoutForce rule.
VERBOSE: Running PSAvoidUsingUserNameAndPassWordParams rule.
VERBOSE: Running PSAvoidUsingComputerNameHardcoded rule.
VERBOSE: Running PSAvoidUsingConvertToSecureStringWithPlainText rule.
VERBOSE: Running PSAvoidUsingDeprecatedManifestFields rule.
VERBOSE: Running PSAvoidUsingInvokeExpression rule.
VERBOSE: Running PSAvoidUsingPlainTextForPassword rule.
VERBOSE: Running PSAvoidUsingWMICmdlet rule.
VERBOSE: Running PSAvoidUsingWriteHost rule.
VERBOSE: Running PSMisleadingBacktick rule.
VERBOSE: Running PSMissingModuleManifestField rule.
VERBOSE: Running PSPossibleIncorrectComparisonWithNull rule.
VERBOSE: Running PSProvideCommentHelp rule.

   VERBOSE: Running PSAvoidUsingPositionalParameters rule.

VERBOSE: Running PSUseBOMForUnicodeEncodedFile rule.
VERBOSE: Running PSUseApprovedVerbs rule.
VERBOSE: Running PSUseCompatibleCmdlets rule.
VERBOSE: Running PSUseDeclaredVarsMoreThanAssignments rule.
VERBOSE: Running PSUseLiteralInitializerForHashtable rule.
VERBOSE: Running PSUseOutputTypeCorrectly rule.
VERBOSE: Running PSUsePSCredentialType rule.
VERBOSE: Running PSUseCmdletCorrectly rule.
VERBOSE: Running PSUseShouldProcessForStateChangingFunctions rule.
VERBOSE: Running PSUseSingularNouns rule.
VERBOSE: Running PSUseSupportsShouldProcess rule.
VERBOSE: Running PSUseToExportFieldsInManifest rule.
VERBOSE: Running PSUseUTF8EncodingForHelpFile rule.
VERBOSE: Running PSShouldProcess rule.


#Module PSScriptAnalyzer version 1.16.1    
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14409.1012
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14409.1012}
BuildVersion                   10.0.14409.1012
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

#identical with PS core 6.0.1

Severity must be 'Information' or 'Warning' ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions