Handle ParameterBindingException
for PowerShell 5.1
#176004
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which ships with PSReadLine 2.0.0 whose
Get-PSReadLineKeyHandler
function does not support-Chord
. Easiest fix is catching the exception in that rare case and using-Bound
and a filter to do the same thing.Note that most people do upgrade PSReadLine, but there are cases where an inbox PowerShell 5.1 is being used without an update (and it may not always be updateable).
Interestingly
Set-PSReadLineKeyHandler
does have-Chord
in this older version, so it can be left alone.Fixes PowerShell/vscode-powershell#4409 (which should have been an upstream issue).