Closed
Description
I think the Style Guide should just say:
Prefer
CmdletBinding
because functions without CmdletBinding don't get common parameters and therefore do not behave the way users expect them to. For instance, when you call them with common parameters (like-Verbose
or-WhatIf
or-ErrorVariable
), those parameters don't work as expected either.
I could add a few other reasons, mostly around the inconsistency and the fact that you frequently have to upgrade functions to CmdletBinding
which changes their syntax, but my point is that I think the style guide and best practices should strongly recommend writing advanced functions, rather then providing style suggestions for them.
Anyone want to defend the use of non-advanced functions?