Add tests for #1504 PSUseUsingScopeModifierInNewRunspaces by o-l-a-v · Pull Request #2005 · PowerShell/PSScriptAnalyzer
PR Summary
Wrote two tests for issue #1504. The issue is not fixed yet, but I had two scenarios that could easily be added to the relevant test file.
Repro to wrongfully trigger PSUseUsingScopeModifierInNewRunspaces, which I added to test:
# Microsoft.PowerShell.Core \ Start-Job Start-Job -ScriptBlock { Param($Foo) $Foo } -ArgumentList 'Bar' | Receive-Job -Wait -AutoRemoveJob # Microsoft.PowerShell.ThreadJob Start-ThreadJob -ScriptBlock { Param($Foo) $Foo } -ArgumentList 'Bar' | Receive-Job -Wait -AutoRemoveJob
PR Checklist
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Change is not breaking
- Make sure all
.cs,.ps1and.psm1files have the correct copyright header - Make sure you've added a new test if existing tests do not effectively test the code changed and/or updated documentation
- This PR is ready to merge and is not Work in Progress.
- If the PR is work in progress, please add the prefix
WIP:to the beginning of the title and remove the prefix when the PR is ready.
- If the PR is work in progress, please add the prefix