- Notifications
You must be signed in to change notification settings - Fork407
Fix false positive of AvoidAlias rule for implicit aliasing of Get- commands for the CommandType ExternalScript#1386
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ommands for the CommandType ExternalScript
JamesWTruher left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This looks great - do we need any additional validation, or is what we have sufficient?
bergmeister commentedJan 28, 2020
The manual end to end test (in vs code) is all I could as somehow this happens only when PSSA is hosted in the vs code extension where those command info cache entries got populated. |
PR Summary
Fixes#1369
Unfortunately this issue could only be reproduced when PSSA is hosted within PSES where the root of the workspace becomes the working directory of the runspace pool, which causes
Get-Command ..\PathToScript.ps1to return a command type of ExternalScript, which then makes it into the command cache and causes the false positve.The fix is to search only for cmdlets/functions where the implicit
Get-aliasing applies.PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.