다음을 통해 공유


Get-PSReadLineKeyHandler

PSReadLine 모듈의 키 바인딩을 가져옵니다.

구문

Get-PSReadLineKeyHandler
   [-Bound]
   [-Unbound]
   [<CommonParameters>]
Get-PSReadLineKeyHandler
   [-Chord] <String[]>
   [<CommonParameters>]

Description

매개 변수를 지정하지 않으면 PSReadLine 모듈에 대해 현재 바인딩된 키 함수를 반환합니다.

코드 매개 변수가 지정된 경우 cmdlet은 특정 바인딩된 키를 반환합니다.

예제

예제 1: 모든 키 매핑 가져오기

이 명령은 바인딩 및 바인딩되지 않은 모든 키 매핑을 반환합니다.

Get-PSReadLineKeyHandler -Bound -Unbound

Key                   Function                Description
---                   --------                -----------
Enter                 AcceptLine              Accept the input or move to the next line if input is missing a closing token.
Shift+Enter           AddLine                 Move the cursor to the next line without attempting to execute the input
Escape                RevertLine              Equivalent to undo all edits (clears the line except lines imported from history)
LeftArrow             BackwardChar            Move the cursor back one character
RightArrow            ForwardChar             Move the cursor forward one character
Ctrl+LeftArrow        BackwardWord            Move the cursor to the beginning of the current or previous word
Ctrl+RightArrow       NextWord                Move the cursor forward to the start of the next word
Shift+LeftArrow       SelectBackwardChar      Adjust the current selection to include the previous character
Shift+RightArrow      SelectForwardChar       Adjust the current selection to include the next character
Ctrl+Shift+LeftArrow  SelectBackwardWord      Adjust the current selection to include the previous word
Ctrl+Shift+RightArrow SelectNextWord          Adjust the current selection to include the next word
UpArrow               PreviousHistory         Replace the input with the previous item in the history
DownArrow             NextHistory             Replace the input with the next item in the history
Home                  BeginningOfLine         Move the cursor to the beginning of the line
End                   EndOfLine               Move the cursor to the end of the line
Shift+Home            SelectBackwardsLine     Adjust the current selection to include from the cursor to the end of the line
Shift+End             SelectLine              Adjust the current selection to include from the cursor to the start of the line
Delete                DeleteChar              Delete the character under the cursor
Backspace             BackwardDeleteChar      Delete the character before the cursor
Ctrl+Spacebar         MenuComplete            Complete the input if there is a single completion, otherwise complete the input by selecting from a menu o...
Tab                   TabCompleteNext         Complete the input using the next completion
Shift+Tab             TabCompletePrevious     Complete the input using the previous completion
Ctrl+a                SelectAll               Select the entire line. Moves the cursor to the end of the line
Ctrl+c                CopyOrCancelLine        Either copy selected text to the clipboard, or if no text is selected, cancel editing the line with Cancel...
Ctrl+C                Copy                    Copy selected region to the system clipboard.  If no region is selected, copy the whole line
Ctrl+l                ClearScreen             Clear the screen and redraw the current line at the top of the screen
Ctrl+r                ReverseSearchHistory    Search history backwards interactively
...

예제 2: 바인딩된 키 가져오기

이 명령은 바인딩된 키와 키 조합만 반환합니다.

Get-PSReadLineKeyHandler

Key                   Function                Description
---                   --------                -----------
Enter                 AcceptLine              Accept the input or move to the next line if input is missing a closing token.
Shift+Enter           AddLine                 Move the cursor to the next line without attempting to execute the input
Escape                RevertLine              Equivalent to undo all edits (clears the line except lines imported from history)
LeftArrow             BackwardChar            Move the cursor back one character
RightArrow            ForwardChar             Move the cursor forward one character
Ctrl+LeftArrow        BackwardWord            Move the cursor to the beginning of the current or previous word
Ctrl+RightArrow       NextWord                Move the cursor forward to the start of the next word
Shift+LeftArrow       SelectBackwardChar      Adjust the current selection to include the previous character
Shift+RightArrow      SelectForwardChar       Adjust the current selection to include the next character
Ctrl+Shift+LeftArrow  SelectBackwardWord      Adjust the current selection to include the previous word
Ctrl+Shift+RightArrow SelectNextWord          Adjust the current selection to include the next word
UpArrow               PreviousHistory         Replace the input with the previous item in the history
DownArrow             NextHistory             Replace the input with the next item in the history
Home                  BeginningOfLine         Move the cursor to the beginning of the line
End                   EndOfLine               Move the cursor to the end of the line
Shift+Home            SelectBackwardsLine     Adjust the current selection to include from the cursor to the end of the line
Shift+End             SelectLine              Adjust the current selection to include from the cursor to the start of the line
Delete                DeleteChar              Delete the character under the cursor
Backspace             BackwardDeleteChar      Delete the character before the cursor
Ctrl+Spacebar         MenuComplete            Complete the input if there is a single completion, otherwise complete the input by selecting from a menu o...
Tab                   TabCompleteNext         Complete the input using the next completion
...

예제 3: 특정 키 바인딩 가져오기

이 명령은 지정된 키에 대한 바인딩만 반환합니다.

Get-PSReadLineKeyHandler -Chord Enter, Shift+Enter

Key         Function   Description
---         --------   -----------
Enter       AcceptLine Accept the input or move to the next line if input is missing a closing token.
Shift+Enter AddLine    Move the cursor to the next line without attempting to execute the input
...

매개 변수

-Bound

이 cmdlet이 바인딩된 함수를 반환한다는 것을 나타냅니다.

형식:SwitchParameter
Position:Named
Default value:True
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-Chord

특정 키 또는 시퀀스에 바인딩된 함수만 반환합니다.

형식:String[]
별칭:Key
Position:0
Default value:None
필수:True
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-Unbound

이 cmdlet은 바인딩되지 않은 함수를 반환한다는 것을 나타냅니다.

형식:SwitchParameter
Position:Named
Default value:False
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

입력

None

개체를 이 cmdlet으로 파이프할 수 없습니다.

출력

KeyHandler

이 cmdlet은 KeyHandler 개체를 반환합니다.