| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
PoshChan-Bot (@PoshChan) please retry linux |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT), successfully started retry of PowerShell-CI-Linux |
Sorry, something went wrong.
…Tests.ps1 Co-Authored-By: Ilya <darpa@yandex.ru>
|
Unfortunately, this PR didn't fix all problems, because the following tests fail: function foo {}; set-alias foo foo
(gcm -all foo | gcm).Count | Should -Be 2
(gcm -all foo | gcm).ComandType | Should -Be Alias, Function
|
Sorry, something went wrong.
|
Michael Klement (@mklement0) those are different issues not related to piping to Get-Command, please open a new issue for them |
Sorry, something went wrong.
|
Steve Lee (@SteveL-MSFT): These tests do pipe to Get-Command (whose built-in alias is gcm). In what way is this a different issue? |
Sorry, something went wrong.
|
If it helps with getting this resolved, please see #11017 |
Sorry, something went wrong.
|
Michael Klement (@mklement0) my mistake, I only saw the left side of the pipe. In anycase, the root cause is something different. |
Sorry, something went wrong.
|
🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Piping multiple CommandInfo to Get-Command only returns the first result. This is because during discovery of the command it internally builds a cache of commands it has already seen. On the second (or more) times ProcessRecord() is called, that cache is already filled with some results. If the requested CommandInfo (which binds to -Verb and -Noun) happens to be in that cache, then the cmdlet considers that a duplicate and doesn't return that result. The fix in this case is to clear the cache at the start of ProcessRecord() to treat each search as independent.
PR Context
Fix #10851
PR Checklist