Skip to content

PositionalParameterUsed method uses unsafe method to exclude ForEach-Object and Where-Object #210

Closed

Description

@KirkMunro

Right now the PositionalParameterUsed method in Helper.cs automatically ignores any command that has a parameter set with the name ScriptBlockSet. This is done to ensure that warnings about unnamed positional parameters are not raised for ForEach-Object or Where-Object. This is not a safe way to exclude these cmdlets, because other cmdlets or advanced functions could be created with the same parameter set name (especially if someone uses these as an example to follow). Instead, this should identify the ForEach-Object/Where-Object cmdlets by name.

Activity

  1. yutingc commented on Jun 17, 2015

    @yutingc
    Contributor

    This fix has been submitted through #246. Let us know if you have any concerns regarding this rule. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions