Skip to content

GetKeyHandlers needs to be added to ValidateSet attribute #51

Closed
@rkeithhill

Description

@rkeithhill

If I try to add a keybinding to GetKeyHandlers like so:

Set-PSReadlineKeyHandler -Key Ctrl+/ -Function GetKeyHandlers    

I get this error:

Set-PSReadlineKeyHandler : Cannot validate argument on parameter 'Function'. The argument "GetKeyHandlers" does not
belong to the set "AcceptLine,AddLine,BackwardChar,BackwardDeleteChar,BackwardDeleteLine,BackwardKillLine,BackwardWord,
BeginningOfHistory,BeginningOfLine,CancelLine,Complete,DeleteChar,DisableDemoMode,EmacsBackwardWord,EmacsForwardWord,En
ableDemoMode,EndOfHistory,EndOfLine,ExchangePointAndMark,ForwardChar,ForwardDeleteLine,ForwardWord,HistorySearchBackwar
d,HistorySearchForward,KillBackwardWord,KillLine,KillWord,NextHistory,Paste,PossibleCompletions,PreviousHistory,Redo,Re
vertLine,SetKeyHandler,SetMark,TabCompleteNext,TabCompletePrevious,Undo,Yank,YankPop" specified by the ValidateSet
attribute. Supply an argument that is in the set and then try the command again.
At C:\Users\hillr\Documents\WindowsPowerShell\profile.ps1:25 char:63

  • Set-PSReadlineKeyHandler -Key Ctrl+/            -Function GetKeyHandlers
    
  •                                                           ~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Set-PSReadlineKeyHandler], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,PSConsoleUtilities.SetKeyHandlerCommand

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions