Skip to content

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

Closed
@KirkMunro

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions