Skip to content

Suggestion: Parameter modification warning #2059

New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants