PowerShell / PSScriptAnalyzer

Download ScriptAnalyzer from PowerShellGallery
https://www.powershellgallery.com/packages/PSScriptAnalyzer/
MIT License
1.85k stars 373 forks source link

UseProcessBlockForPipelineCommand should flag functions without [CmdletBinding()] defined. #1890

Closed david-tap closed 1 year ago

david-tap commented 1 year ago

Powershell functions can take input from the pipeline, even when [CmdletBinding()] is not used. The process block is still required, though. The tests should not depend on [CmdletBinding()] being present.

bergmeister commented 1 year ago

@mattmcnabb contributed the rule, what are your thoughts?

david-tap commented 1 year ago

I'm sorry, I guess I did not test this right. It's flagging either way now.