-
Notifications
You must be signed in to change notification settings - Fork 395
The ProvideVerboseMessage rule should be limited to functions that support ShouldProcess #181
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
Comments
The link you provided states:
but the rule right now is:
Very different results. |
Francis. Currently, the rule is "Information" level and applies to functions that have the CmdletBinding() attribute specified to reduce noise. This is a good practice since it gives debug information about the cmdlet actions. In what scenarios are you seeing a lot of noise? Thanks, |
There are a lot of functions that shouldn't have verbose messages (look at the PowerShell cmdlets that don't have verbose messages), but this rule encourages scripters to add them anyway without giving a hint about what to put in those messages. So, new scripters will probably end up writing messages like:
or
and so on. Experienced scripters who do not want verbose messages, but must follow this rule (for whatever reason), will end up with code like this:
or
and so on. I think the way this rule is written right now will ultimately do more harm than good. |
If the link that @GoodOlClint provided is what this rule is supposed to enforce, then the rule misinterpreted the best practice. |
This is fixed by #238 |
A lot of functions don't need verbose messages, and having them output verbose messages will just create noise.
PowerShell itself has many cmdlets that don't write verbose messages, such as ForEach-Object, Test-Path, Get-ChildItem, etc.
I think that the $VerbosePreference variable will become useless if everyone followed this rule the way it is now because of all the noise that will be generated.
The text was updated successfully, but these errors were encountered: