Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PSReviewUnusedParameter false positive for ValueFromPipeline#2072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@liamjpeters
Copy link
Contributor

@liamjpetersliamjpeters commentedMar 3, 2025
edited
Loading

PR Summary

Whether good practice or not, a parameter defined withValueFromPipeline is flagged as unused when referred to by$_ or$PSItem within the process block of a function.

This PR checks forValueFromPipeline when the parameter's usage is inspected. If set,$_ and$PSItem count towards it's usage when seen in a process block.

Fixes#1840

PR Checklist

@liamjpetersliamjpeters marked this pull request as ready for reviewMarch 4, 2025 09:36
@andyleejordanandyleejordanenabled auto-merge (squash)March 6, 2025 20:00
auto-merge was automatically disabledMarch 10, 2025 19:30

Head branch was pushed to by a user without write access

Copy link
Collaborator

@bergmeisterbergmeister left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, thanks, retriggered CI

liamjpetersand others added5 commitsMarch 13, 2025 10:05
…t directly contains variable usage of $_ or $PSItem. Then when we encounted a parameter with ValueFromPipeline set, we consider whether we saw usage within a process block by automatic variable.
Co-authored-by: Andy Jordan <2226434+andyleejordan@users.noreply.github.com>
@andyleejordanandyleejordanforce-pushed the#1840PSReviewUnusedParameterVsValueFromPipeline branch from95e1486 tod83b1d9CompareMarch 13, 2025 17:05
@andyleejordanandyleejordan merged commit1d394ee intoPowerShell:mainMar 13, 2025
4 checks passed
@liamjpetersliamjpeters deleted the #1840PSReviewUnusedParameterVsValueFromPipeline branchAugust 7, 2025 12:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@andyleejordanandyleejordanandyleejordan approved these changes

@bergmeisterbergmeisterbergmeister approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

PSReviewUnusedParameter false positive for ValueFromPipeline and current process item$_

3 participants

@liamjpeters@andyleejordan@bergmeister

[8]ページ先頭

©2009-2025 Movatter.jp