Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Parameter modification warning #2059

Open
sirtao opened this issue Feb 11, 2025 · 0 comments
Open

Suggestion: Parameter modification warning #2059

sirtao opened this issue Feb 11, 2025 · 0 comments

Comments

@sirtao
Copy link

sirtao commented Feb 11, 2025

Summary of the new feature

User has a function with a a parameter called, for this example, $PassedParam.
Inside the function, the $PassedParam is assigned with a new value.
This cause the type constrainment and the various Validate attributes checks to trigger again.

I propose a warning to suggest the user to treat parameters as read-only

What is the latest version of PSScriptAnalyzer at the point of writing

1.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant