◐ Shell
clean mode source ↗

ReviewUnusedParameter: Do not trigger when MyInvocation.BoundParameters or PSCmdlet.MyInvocation.BoundParameters is used by jegannathanmaniganadan · Pull Request #1520 · PowerShell/PSScriptAnalyzer

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Implementation looks good to me, just a minor suggestion.
Every new feature or fix needs to be accompanied by one or more test cases though. If you look qt the existing tests, it should be very easy to add 2 tests for the cases that you added:

It "has no violations when using PSBoundParameters" {
$ScriptDefinition = 'function Bound { param ($Param1) Get-Foo @PSBoundParameters }'
$Violations = Invoke-ScriptAnalyzer -ScriptDefinition $ScriptDefinition -IncludeRule $RuleName
$Violations.Count | Should -Be 0
}

Also, when you use a closing keyword in the PR description it will close the referenced issue
https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword