Skip to content

Commit

Permalink
Sync PSReadLine docs from source (MicrosoftDocs#5871)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwheeler authored Apr 30, 2020
1 parent 1bb69ec commit 4bda108
Show file tree
Hide file tree
Showing 31 changed files with 1,475 additions and 1,010 deletions.
1,370 changes: 911 additions & 459 deletions reference/5.1/PSReadline/About/about_PSReadline.md

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions reference/5.1/PSReadline/Get-PSReadlineKeyHandler.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
external help file: Microsoft.PowerShell.PSReadLine.dll-Help.xml
external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: PSReadLine
Expand Down Expand Up @@ -140,8 +140,8 @@ Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information,
see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand All @@ -153,9 +153,6 @@ You cannot pipe objects to this cmdlet.
### Microsoft.PowerShell.KeyHandler
This cmdlet returns one entry for each key binding, or chord, for bound functions and one entry for
each unbound function.
## NOTES
## RELATED LINKS
Expand Down
82 changes: 36 additions & 46 deletions reference/5.1/PSReadline/Get-PSReadlineOption.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
external help file: Microsoft.PowerShell.PSReadLine.dll-Help.xml
external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: PSReadLine
Expand All @@ -8,7 +8,6 @@ online version: https://docs.microsoft.com/powershell/module/psreadline/get-psre
schema: 2.0.0
title: Get-PSReadLineOption
---

# Get-PSReadLineOption

## SYNOPSIS
Expand Down Expand Up @@ -37,54 +36,42 @@ Get-PSReadLineOption

```Output
EditMode : Windows
ContinuationPrompt : >>
ContinuationPromptForegroundColor : DarkYellow
ContinuationPromptBackgroundColor : DarkMagenta
ExtraPromptLineCount : 0
AddToHistoryHandler :
CommandValidationHandler :
CommandsToValidateScriptBlockArguments : {ForEach-Object, %, Invoke-Command, icm...}
HistoryNoDuplicates : False
MaximumHistoryCount : 4096
MaximumKillRingCount : 10
HistoryNoDuplicates : True
HistorySavePath : C:\Users\testuser\AppData\Roaming\Microsoft\Win
dows\PowerShell\PSReadLine\ConsoleHost_history.txt
HistorySaveStyle : SaveIncrementally
HistorySearchCaseSensitive : False
HistorySearchCursorMovesToEnd : False
ShowToolTips : False
MaximumHistoryCount : 4096
ContinuationPrompt : >>
ExtraPromptLineCount : 0
PromptText :
BellStyle : Audible
DingDuration : 50
DingTone : 1221
CommandsToValidateScriptBlockArguments : {ForEach-Object, %, Invoke-Command, icm...}
CommandValidationHandler :
CompletionQueryItems : 100
WordDelimiters : ;:,.[]{}()/\|^&*-=+'"
DingDuration : 50
BellStyle : Audible
HistorySearchCaseSensitive : False
MaximumKillRingCount : 10
ShowToolTips : True
ViModeIndicator : None
HistorySavePath : C:\Users\testuser\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\Cons
oleHost_history.txt
HistorySaveStyle : SaveIncrementally
DefaultTokenForegroundColor : DarkYellow
CommentForegroundColor : DarkGreen
KeywordForegroundColor : Green
StringForegroundColor : DarkCyan
OperatorForegroundColor : DarkGray
VariableForegroundColor : Green
CommandForegroundColor : Yellow
ParameterForegroundColor : DarkGray
TypeForegroundColor : Gray
NumberForegroundColor : White
MemberForegroundColor : White
DefaultTokenBackgroundColor : DarkMagenta
CommentBackgroundColor : DarkMagenta
KeywordBackgroundColor : DarkMagenta
StringBackgroundColor : DarkMagenta
OperatorBackgroundColor : DarkMagenta
VariableBackgroundColor : DarkMagenta
CommandBackgroundColor : DarkMagenta
ParameterBackgroundColor : DarkMagenta
TypeBackgroundColor : DarkMagenta
NumberBackgroundColor : DarkMagenta
MemberBackgroundColor : DarkMagenta
EmphasisForegroundColor : Cyan
EmphasisBackgroundColor : DarkMagenta
ErrorForegroundColor : Red
ErrorBackgroundColor : DarkMagenta
WordDelimiters : ;:,.[]{}()/\|^&*-=+'"–—-
CommandColor : "$([char]0x1b)[93m"
CommentColor : "$([char]0x1b)[32m"
ContinuationPromptColor : "$([char]0x1b)[37m"
DefaultTokenColor : "$([char]0x1b)[37m"
EmphasisColor : "$([char]0x1b)[96m"
ErrorColor : "$([char]0x1b)[91m"
KeywordColor : "$([char]0x1b)[92m"
MemberColor : "$([char]0x1b)[97m"
NumberColor : "$([char]0x1b)[97m"
OperatorColor : "$([char]0x1b)[90m"
ParameterColor : "$([char]0x1b)[90m"
SelectionColor : "$([char]0x1b)[30;47m"
StringColor : "$([char]0x1b)[36m"
TypeColor : "$([char]0x1b)[37m"
VariableColor : "$([char]0x1b)[92m"
```

This command returns the list of available PSReadLine options and their current values.
Expand All @@ -96,7 +83,7 @@ This command returns the list of available PSReadLine options and their current
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

Expand All @@ -108,6 +95,9 @@ You cannot pipe objects to this cmdlet.

### Microsoft.PowerShell.PSConsoleReadLineOptions

An instance of the current options. Changing the property values of this object updates the settings
in PSReadLine directly without invoking `Set-PSReadLineOption`.

## NOTES

## RELATED LINKS
Expand Down
7 changes: 4 additions & 3 deletions reference/5.1/PSReadline/PSConsoleHostReadline.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ PSConsoleHostReadLine
## DESCRIPTION

`PSConsoleHostReadLine` is the main entry point for the PSReadLine module. The PowerShell console
host automatically loads the PSReadLine modules and calls this function. Under normal operating
host automatically loads the PSReadLine module and calls this function. Under normal operating
conditions, this function is not intended to be used from the command line.

If you wanted to create your own custom ReadLine function, you could replace this function with
your own implementation.
The extension point `PSConsoleHostReadLine` is special to the console host. The host calls any
alias, function, or script with this name. PSReadLine defines this function so that it is called
from the console host.

## EXAMPLES

Expand Down
20 changes: 12 additions & 8 deletions reference/5.1/PSReadline/PSReadline.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ title: PSReadLine
## Description

The PSReadLine module contains cmdlets that let you customize the command-line editing environment
in PowerShell. These articles documents PSReadLine v1.2. This version ships in PowerShell v5.1 and
below.
in PowerShell. These articles documents PSReadLine v2.0. This version ships in PowerShell v6 and
the Windows 10 October 2018 Update (Build 1809).


## PSReadLine Cmdlets

Expand All @@ -25,14 +26,17 @@ The main entry point for PSReadLine.
### [Get-PSReadLineKeyHandler](Get-PSReadLineKeyHandler.md)
Gets the key bindings for the PSReadLine module.

### [Get-PSReadLineOption](Get-PSReadLineOption.md)
Gets values for the options that can be configured.
### [Get-PSReadlineOption](Get-PSReadlineOption.md)
Returns the values for the options that can be configured.

### [PSConsoleHostReadline](PSConsoleHostReadline.md)
This function is the main entry point for PSReadLine.

### [Remove-PSReadLineKeyHandler](Remove-PSReadLineKeyHandler.md)
### [Remove-PSReadlineKeyHandler](Remove-PSReadlineKeyHandler.md)
Removes a key binding.

### [Set-PSReadLineKeyHandler](Set-PSReadLineKeyHandler.md)
Binds keys to user-defined or PSReadLine-provided key handlers.
### [Set-PSReadlineKeyHandler](Set-PSReadlineKeyHandler.md)
Binds keys to user-defined or PSReadLine key handler functions.

### [Set-PSReadLineOption](Set-PSReadLineOption.md)
### [Set-PSReadlineOption](Set-PSReadlineOption.md)
Customizes the behavior of command line editing in PSReadLine.
13 changes: 6 additions & 7 deletions reference/5.1/PSReadline/Remove-PSReadlineKeyHandler.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
external help file: Microsoft.PowerShell.PSReadLine.dll-Help.xml
external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: PSReadLine
Expand Down Expand Up @@ -29,11 +29,11 @@ The `Remove-PSReadLineKeyHandler` cmdlet removes a specified key binding.
### Example 1: Remove a binding

```powershell
Remove-PSReadLineKeyHandler -Chord Ctrl+Shift+B
Remove-PSReadLineKeyHandler -Chord Ctrl+B
```

This command removes the binding from the key combination, or chord, `Ctrl+Shift+B`.
The `Ctrl+Shift+B` chord is created in the `Set-PSReadLineKeyHandler` article.
This command removes the binding from the key combination, or chord, `Ctrl+B`. The `Ctrl+B` chord is
created in the `Set-PSReadLineKeyHandler` article.

## PARAMETERS

Expand All @@ -43,7 +43,7 @@ Specifies an array of keys or sequences of keys to be removed. A single binding
using a single string. If the binding is a sequence of keys, separate the keys by a comma, as in
the following example:

`Ctrl+X,Ctrl+L`
`Ctrl+x,Ctrl+l`

This parameter accepts an array of strings. Each string is a separate binding, not a sequence of
keys for a single binding.
Expand Down Expand Up @@ -82,7 +82,7 @@ Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
-WarningAction, and -WarningVariable. For more information, see
[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
[about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand All @@ -105,4 +105,3 @@ You cannot pipe objects to this cmdlet.
[Set-PSReadLineOption](Set-PSReadLineOption.md)
[Set-PSReadLineKeyHandler](Set-PSReadLineKeyHandler.md)
26 changes: 12 additions & 14 deletions reference/5.1/PSReadline/Set-PSReadlineKeyHandler.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
external help file: Microsoft.PowerShell.PSReadLine.dll-Help.xml
external help file: Microsoft.PowerShell.PSReadLine2.dll-Help.xml
keywords: powershell,cmdlet
locale: en-us
Module Name: PSReadLine
Expand All @@ -8,7 +8,6 @@ online version: https://docs.microsoft.com/powershell/module/psreadline/set-psre
schema: 2.0.0
title: Set-PSReadLineKeyHandler
---

# Set-PSReadLineKeyHandler

## SYNOPSIS
Expand All @@ -19,14 +18,15 @@ Binds keys to user-defined or PSReadLine key handler functions.
### ScriptBlock

```
Set-PSReadLineKeyHandler [-ScriptBlock] <ScriptBlock> [-BriefDescription <String>] [-Description <String>]
[-Chord] <String[]> [-ViMode <ViMode>] [<CommonParameters>]
Set-PSReadLineKeyHandler [-ScriptBlock] <ScriptBlock> [-BriefDescription <String>]
[-Description <String>] [-Chord] <String[]> [-ViMode <ViMode>] [<CommonParameters>]
```

### Function

```
Set-PSReadLineKeyHandler [-Chord] <String[]> [-ViMode <ViMode>] [-Function] <String> [<CommonParameters>]
Set-PSReadLineKeyHandler [-Chord] <String[]> [-ViMode <ViMode>] [-Function] <String>
[<CommonParameters>]
```

## DESCRIPTION
Expand All @@ -39,21 +39,20 @@ PowerShell script.

### Example 1: Bind the arrow key to a function

This command binds the up arrow key to the function **HistorySearchBackward**. This function uses
the current contents of the command line as the search string used to search the command history.
This command binds the up arrow key to the **HistorySearchBackward** function. This function
searches command history for command lines that start with the current contents of the command line.

```powershell
Set-PSReadLineKeyHandler -Chord UpArrow -Function HistorySearchBackward
```

### Example 2: Bind a key to a script block

This example shows how a single key can be used to run a command. The command binds the key
`Ctrl+Shift+B` to a script block that clears the line, inserts the word "build", and then accepts
the line.
This example shows how a single key can be used to run a command. The command binds the key `Ctrl+B`
to a script block that clears the line, inserts the word "build", and then accepts the line.

```powershell
Set-PSReadLineKeyHandler -Chord Ctrl+Shift+B -ScriptBlock {
Set-PSReadLineKeyHandler -Chord Ctrl+B -ScriptBlock {
[Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
[Microsoft.PowerShell.PSConsoleReadLine]::Insert('build')
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
Expand Down Expand Up @@ -128,7 +127,6 @@ rebind existing key bindings, or bind a handler that is currently unbound.
Type: String
Parameter Sets: Function
Aliases:
Accepted values: Abort, AcceptAndGetNext, AcceptLine, AddLine, BackwardChar, BackwardDeleteChar, BackwardDeleteLine, BackwardDeleteWord, BackwardKillLine, BackwardKillWord, BackwardWord, BeginningOfHistory, BeginningOfLine, CancelLine, CaptureScreen, CharacterSearch, CharacterSearchBackward, ClearHistory, ClearScreen, Complete, Copy, CopyOrCancelLine, Cut, DeleteChar, DeleteCharOrExit, DeleteEndOfWord, DeleteLine, DeleteLineToFirstChar, DeleteToEnd, DeleteWord, DigitArgument, EndOfHistory, EndOfLine, ExchangePointAndMark, ForwardChar, ForwardDeleteLine, ForwardSearchHistory, ForwardWord, GotoBrace, GotoColumn, GotoFirstNonBlankOfLine, HistorySearchBackward, HistorySearchForward, InsertLineAbove, InsertLineBelow, InvertCase, InvokePrompt, KillLine, KillRegion, KillWord, MenuComplete, MoveToEndOfLine, NextHistory, NextLine, NextWord, NextWordEnd, Paste, PasteAfter, PasteBefore, PossibleCompletions, PrependAndAccept, PreviousHistory, PreviousLine, Redo, RepeatLastCharSearch, RepeatLastCharSearchBackwards, RepeatLastCommand, RepeatSearch, RepeatSearchBackward, ReverseSearchHistory, RevertLine, ScrollDisplayDown, ScrollDisplayDownLine, ScrollDisplayToCursor, ScrollDisplayTop, ScrollDisplayUp, ScrollDisplayUpLine, SearchChar, SearchCharBackward, SearchCharBackwardWithBackoff, SearchCharWithBackoff, SearchForward, SelectAll, SelectBackwardChar, SelectBackwardsLine, SelectBackwardWord, SelectForwardChar, SelectForwardWord, SelectLine, SelectNextWord, SelectShellBackwardWord, SelectShellForwardWord, SelectShellNextWord, SelfInsert, SetMark, ShellBackwardKillWord, ShellBackwardWord, ShellForwardWord, ShellKillWord, ShellNextWord, ShowKeyBindings, SwapCharacters, TabCompleteNext, TabCompletePrevious, Undo, UndoAll, UnixWordRubout, ValidateAndAcceptLine, ViAcceptLine, ViAcceptLineOrExit, ViAppendLine, ViBackwardDeleteGlob, ViBackwardGlob, ViBackwardWord, ViCommandMode, ViDeleteBrace, ViDeleteEndOfGlob, ViDeleteGlob, ViDigitArgumentInChord, ViEditVisually, ViExit, ViGotoBrace, ViInsertAtBegining, ViInsertAtEnd, ViInsertLine, ViInsertMode, ViInsertWithAppend, ViInsertWithDelete, ViJoinLines, ViNextWord, ViSearchHistoryBackward, ViTabCompleteNext, ViTabCompletePrevious, ViYankBeginningOfLine, ViYankEndOfGlob, ViYankEndOfWord, ViYankLeft, ViYankLine, ViYankNextGlob, ViYankNextWord, ViYankPercent, ViYankPreviousGlob, ViYankPreviousWord, ViYankRight, ViYankToEndOfLine, ViYankToFirstChar, WhatIsKey, Yank, YankLastArg, YankNthArg, YankPop
Required: True
Position: 1
Expand Down Expand Up @@ -168,7 +166,6 @@ Valid values are:
Type: ViMode
Parameter Sets: (All)
Aliases:
Accepted values: Insert, Command
Required: False
Position: Named
Expand All @@ -194,6 +191,8 @@ You cannot pipe objects to this cmdlet.

### None

This cmdlet does not generate any output.

## NOTES

## RELATED LINKS
Expand All @@ -205,4 +204,3 @@ You cannot pipe objects to this cmdlet.
[Get-PSReadLineOption](Get-PSReadLineOption.md)

[Set-PSReadLineOption](Set-PSReadLineOption.md)

Loading

0 comments on commit 4bda108

Please sign in to comment.