Skip to content

Commit 98d9927

Browse files
committed
Update help files.
1 parent 4e5bf1c commit 98d9927

File tree

2 files changed

+212
-57
lines changed

2 files changed

+212
-57
lines changed

PSReadLine/en-US/PSReadline.dll-help.xml

Lines changed: 168 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,74 @@
6161
</maml:relatedLinks>
6262
</command:command>
6363
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
64+
<!--Generated by PS Help Cmdlet Editor-->
65+
<command:details>
66+
<command:name>Get-PSReadlineOption</command:name>
67+
<maml:description>
68+
<maml:para>Returns the values for the options that can be configured.</maml:para>
69+
</maml:description>
70+
<maml:copyright>
71+
<maml:para />
72+
</maml:copyright>
73+
<command:verb>Get</command:verb>
74+
<command:noun>PSReadlineOption</command:noun>
75+
<dev:version />
76+
</command:details>
77+
<maml:description>
78+
<!--This is the Description section-->
79+
<maml:para>Get-PSReadlineOption returns the current state of the settings that can be configured by Set-PSReadlineOption.
80+
81+
The object returned can be used to change PSReadline options. This provides a slightly simpler way of setting syntax coloring options for multiple kinds of tokens.</maml:para>
82+
</maml:description>
83+
<command:syntax>
84+
<command:syntaxItem>
85+
<maml:name>Get-PSReadlineOption</maml:name>
86+
</command:syntaxItem>
87+
</command:syntax>
88+
<command:parameters> </command:parameters>
89+
<command:inputTypes>
90+
<command:inputType>
91+
<dev:type>
92+
<maml:name></maml:name>
93+
<maml:uri/>
94+
<maml:description>
95+
<maml:para></maml:para>
96+
</maml:description>
97+
</dev:type>
98+
<maml:description></maml:description>
99+
</command:inputType>
100+
</command:inputTypes>
101+
<command:returnValues>
102+
<command:returnValue>
103+
<dev:type>
104+
<maml:name></maml:name>
105+
<maml:uri/>
106+
<maml:description>
107+
<maml:para></maml:para>
108+
</maml:description>
109+
</dev:type>
110+
<maml:description></maml:description>
111+
</command:returnValue>
112+
</command:returnValues>
113+
<command:terminatingErrors></command:terminatingErrors>
114+
<command:nonTerminatingErrors></command:nonTerminatingErrors>
115+
<maml:alertSet>
116+
<maml:title></maml:title>
117+
<maml:alert>
118+
<maml:para></maml:para>
119+
</maml:alert>
120+
</maml:alertSet>
121+
<command:examples>
122+
</command:examples>
123+
<maml:relatedLinks>
124+
</maml:relatedLinks>
125+
</command:command>
126+
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
64127
<!--Generated by PS Help Cmdlet Editor-->
65128
<command:details>
66129
<command:name>Set-PSReadlineKeyHandler</command:name>
67130
<maml:description>
68-
<maml:para>Changes key bindings</maml:para>
131+
<maml:para>Binds or rebinds keys to user defined or PSReadline provided key handlers.</maml:para>
69132
</maml:description>
70133
<maml:copyright>
71134
<maml:para />
@@ -76,32 +139,34 @@
76139
</command:details>
77140
<maml:description>
78141
<!--This is the Description section-->
79-
<maml:para></maml:para>
142+
<maml:para>This cmdlet is used to customize what happens when a particular key or sequence of keys is pressed while PSReadline is reading input.
143+
144+
With user defined key bindings, you can do nearly anything that is possible from a PowerShell script. Typically you might just edit the command line in some novel way, but because the handlers are just PowerShell scripts, you can do interesting things like change directories, launch programs, etc.</maml:para>
80145
</maml:description>
81146
<command:syntax>
82147
<command:syntaxItem>
83148
<maml:name>Set-PSReadlineKeyHandler</maml:name>
84-
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0">
85-
<maml:name>Key</maml:name>
149+
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="0">
150+
<maml:name>Chord</maml:name>
86151
<maml:description>
87-
<maml:para>Specifies the key to be bound.</maml:para>
152+
<maml:para>The key or sequence of keys to be bound to a Function or ScriptBlock. A single binding is specified with a single string. If the binding is a sequence of keys, the keys are separated with a comma, e.g. &quot;Ctrl+X,Ctrl+X&quot;. Note that this parameter accepts multiple strings. Each string is a separate binding, not a sequence of keys for a single binding.</maml:para>
88153
</maml:description>
89-
<command:parameterValue required="true" variableLength="false">ConsoleKeyInfo</command:parameterValue>
154+
<command:parameterValue required="true" variableLength="true">String[]</command:parameterValue>
90155
</command:parameter>
91156
</command:syntaxItem>
92157
<command:syntaxItem>
93158
<maml:name>Set-PSReadlineKeyHandler</maml:name>
94159
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
95-
<maml:name>Handler</maml:name>
160+
<maml:name>ScriptBlock</maml:name>
96161
<maml:description>
97-
<maml:para>Specifies a ScriptBlock to be called when the bound key is pressed.</maml:para>
162+
<maml:para>The ScriptBlock is called when the Chord is entered. The ScriptBlock is passed one or sometimes two arguments. The first argument is the key pressed (a ConsoleKeyInfo.) The second argument could be any object depending on the context.</maml:para>
98163
</maml:description>
99-
<command:parameterValue required="true" variableLength="false">Action</command:parameterValue>
164+
<command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
100165
</command:parameter>
101166
</command:syntaxItem>
102167
<command:syntaxItem>
103168
<maml:name>Set-PSReadlineKeyHandler</maml:name>
104-
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
169+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
105170
<maml:name>BriefDescription</maml:name>
106171
<maml:description>
107172
<maml:para>A brief description of the key binding. Used in the output of cmdlet Get-PSReadlineKeyHandler.</maml:para>
@@ -121,41 +186,43 @@
121186
</command:syntaxItem>
122187
<command:syntaxItem>
123188
<maml:name>Set-PSReadlineKeyHandler</maml:name>
124-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
125-
<maml:name>CtrlXPrefix</maml:name>
189+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
190+
<maml:name>Function</maml:name>
126191
<maml:description>
127-
<maml:para></maml:para>
192+
<maml:para>The name of an existing key handler provided by PSReadline. This parameter allows one to rebind existing key bindings or to bind a handler provided by PSReadline that is currently unbound.
193+
194+
Using the ScriptBlock parameter, one can achieve equivalent functionality by calling the method directly from the ScriptBlock. This parameter is preferred though - it makes it easier to determine which functions are bound and unbound.</maml:para>
128195
</maml:description>
129-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
196+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
130197
</command:parameter>
131198
</command:syntaxItem>
132199
</command:syntax>
133200
<command:parameters>
134-
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0">
135-
<maml:name>Key</maml:name>
201+
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="false" position="0">
202+
<maml:name>Chord</maml:name>
136203
<maml:description>
137-
<maml:para>Specifies the key to be bound.</maml:para>
204+
<maml:para>The key or sequence of keys to be bound to a Function or ScriptBlock. A single binding is specified with a single string. If the binding is a sequence of keys, the keys are separated with a comma, e.g. &quot;Ctrl+X,Ctrl+X&quot;. Note that this parameter accepts multiple strings. Each string is a separate binding, not a sequence of keys for a single binding.</maml:para>
138205
</maml:description>
139-
<command:parameterValue required="true" variableLength="false">ConsoleKeyInfo</command:parameterValue>
206+
<command:parameterValue required="true" variableLength="true">String[]</command:parameterValue>
140207
<dev:type>
141-
<maml:name>ConsoleKeyInfo</maml:name>
208+
<maml:name>String[]</maml:name>
142209
<maml:uri/>
143210
</dev:type>
144211
<dev:defaultValue></dev:defaultValue>
145212
</command:parameter>
146213
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
147-
<maml:name>Handler</maml:name>
214+
<maml:name>ScriptBlock</maml:name>
148215
<maml:description>
149-
<maml:para>Specifies a ScriptBlock to be called when the bound key is pressed.</maml:para>
216+
<maml:para>The ScriptBlock is called when the Chord is entered. The ScriptBlock is passed one or sometimes two arguments. The first argument is the key pressed (a ConsoleKeyInfo.) The second argument could be any object depending on the context.</maml:para>
150217
</maml:description>
151-
<command:parameterValue required="true" variableLength="false">Action</command:parameterValue>
218+
<command:parameterValue required="true" variableLength="false">ScriptBlock</command:parameterValue>
152219
<dev:type>
153-
<maml:name>Action</maml:name>
220+
<maml:name>ScriptBlock</maml:name>
154221
<maml:uri/>
155222
</dev:type>
156223
<dev:defaultValue></dev:defaultValue>
157224
</command:parameter>
158-
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named">
225+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
159226
<maml:name>BriefDescription</maml:name>
160227
<maml:description>
161228
<maml:para>A brief description of the key binding. Used in the output of cmdlet Get-PSReadlineKeyHandler.</maml:para>
@@ -179,14 +246,52 @@
179246
</dev:type>
180247
<dev:defaultValue></dev:defaultValue>
181248
</command:parameter>
249+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
250+
<maml:name>Function</maml:name>
251+
<maml:description>
252+
<maml:para>The name of an existing key handler provided by PSReadline. This parameter allows one to rebind existing key bindings or to bind a handler provided by PSReadline that is currently unbound.
253+
254+
Using the ScriptBlock parameter, one can achieve equivalent functionality by calling the method directly from the ScriptBlock. This parameter is preferred though - it makes it easier to determine which functions are bound and unbound.</maml:para>
255+
</maml:description>
256+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
257+
<dev:type>
258+
<maml:name>String</maml:name>
259+
<maml:uri/>
260+
</dev:type>
261+
<dev:defaultValue></dev:defaultValue>
262+
</command:parameter>
263+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="0">
264+
<maml:name>Key</maml:name>
265+
<maml:description>
266+
<maml:para>Specifies the key to be bound.</maml:para>
267+
</maml:description>
268+
<command:parameterValue required="true" variableLength="false">consolekeyinfo</command:parameterValue>
269+
<dev:type>
270+
<maml:name>consolekeyinfo</maml:name>
271+
<maml:uri/>
272+
</dev:type>
273+
<dev:defaultValue></dev:defaultValue>
274+
</command:parameter>
275+
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1">
276+
<maml:name>Handler</maml:name>
277+
<maml:description>
278+
<maml:para>Specifies a ScriptBlock to be called when the bound key is pressed.</maml:para>
279+
</maml:description>
280+
<command:parameterValue required="true" variableLength="false">action</command:parameterValue>
281+
<dev:type>
282+
<maml:name>action</maml:name>
283+
<maml:uri/>
284+
</dev:type>
285+
<dev:defaultValue></dev:defaultValue>
286+
</command:parameter>
182287
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
183288
<maml:name>CtrlXPrefix</maml:name>
184289
<maml:description>
185290
<maml:para></maml:para>
186291
</maml:description>
187-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
292+
<command:parameterValue required="false" variableLength="false">switchparameter</command:parameterValue>
188293
<dev:type>
189-
<maml:name>SwitchParameter</maml:name>
294+
<maml:name>switchparameter</maml:name>
190295
<maml:uri/>
191296
</dev:type>
192297
<dev:defaultValue></dev:defaultValue>
@@ -230,10 +335,7 @@
230335
<maml:introduction>
231336
<maml:para></maml:para>
232337
</maml:introduction>
233-
<dev:code>PS C:\&gt; Set-PSReadlineKeyHandler -Key UpArrow -BriefDescription HistorySearchBackward -Handler {
234-
[PSConsoleUtilities.PSConsoleReadLine]::HistorySearchBackward()
235-
}
236-
</dev:code>
338+
<dev:code>PS C:\&gt; Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward</dev:code>
237339
<dev:remarks>
238340
<maml:para>This command binds the up arrow key to the function HistorySearchBackward which will use the currently entered command line as the beginning of the search string when searching through history.</maml:para>
239341
</dev:remarks>
@@ -243,6 +345,25 @@
243345
</command:commandLine>
244346
</command:commandLines>
245347
</command:example>
348+
<command:example>
349+
<maml:title>-------------- Example 2 --------------</maml:title>
350+
<maml:introduction>
351+
<maml:para></maml:para>
352+
</maml:introduction>
353+
<dev:code>PS C:\&gt; Set-PSReadlineKeyHandler -Chord Shift+Ctrl+B -ScriptBlock {
354+
[PSConsoleUtilities.PSConsoleReadLine]::RevertLine()
355+
[PSConsoleUtilities.PSConsoleReadLine]::Insert(&apos;build&apos;)
356+
&gt;&gt;&gt; [PSConsoleUtilities.PSConsoleReadLine]::AcceptLine()
357+
}</dev:code>
358+
<dev:remarks>
359+
<maml:para>This example binds the key Ctrl+Shift+B to a script block that clears the line, inserts build, then accepts the line. This example shows how a single key can be used to execute a command.</maml:para>
360+
</dev:remarks>
361+
<command:commandLines>
362+
<command:commandLine>
363+
<command:commandText></command:commandText>
364+
</command:commandLine>
365+
</command:commandLines>
366+
</command:example>
246367
</command:examples>
247368
<maml:relatedLinks>
248369
</maml:relatedLinks>
@@ -271,7 +392,7 @@
271392
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
272393
<maml:name>EditMode</maml:name>
273394
<maml:description>
274-
<maml:para>Specifies s the command line editing mode. This will reset any key bindings set by Set-PSReadlineKeyHandler.</maml:para>
395+
<maml:para>Specifies the command line editing mode. This will reset any key bindings set by Set-PSReadlineKeyHandler.</maml:para>
275396
</maml:description>
276397
<command:parameterValue required="true" variableLength="false">EditMode</command:parameterValue>
277398
</command:parameter>
@@ -336,22 +457,12 @@
336457
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
337458
</command:parameter>
338459
</command:syntaxItem>
339-
<command:syntaxItem>
340-
<maml:name>Set-PSReadlineOption</maml:name>
341-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
342-
<maml:name>MinimumHistoryCommandLength</maml:name>
343-
<maml:description>
344-
<maml:para>Specifies the minimum length command to save in PSReadline history. Note that PSReadline history is separate from PowerShell history. </maml:para>
345-
</maml:description>
346-
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
347-
</command:parameter>
348-
</command:syntaxItem>
349460
<command:syntaxItem>
350461
<maml:name>Set-PSReadlineOption</maml:name>
351462
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
352463
<maml:name>MaximumHistoryCount</maml:name>
353464
<maml:description>
354-
<maml:para>Specifies the maximum number of commands to save in PSReadline history. Note that PSReadline history is separate from PowerShell history. </maml:para>
465+
<maml:para>Specifies the maximum number of commands to save in PSReadline history. Note that PSReadline history is separate from PowerShell history.</maml:para>
355466
</maml:description>
356467
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
357468
</command:parameter>
@@ -461,7 +572,7 @@
461572
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
462573
<maml:name>EditMode</maml:name>
463574
<maml:description>
464-
<maml:para>Specifies s the command line editing mode. This will reset any key bindings set by Set-PSReadlineKeyHandler.</maml:para>
575+
<maml:para>Specifies the command line editing mode. This will reset any key bindings set by Set-PSReadlineKeyHandler.</maml:para>
465576
</maml:description>
466577
<command:parameterValue required="true" variableLength="false">EditMode</command:parameterValue>
467578
<dev:type>
@@ -542,22 +653,10 @@
542653
</dev:type>
543654
<dev:defaultValue></dev:defaultValue>
544655
</command:parameter>
545-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
546-
<maml:name>MinimumHistoryCommandLength</maml:name>
547-
<maml:description>
548-
<maml:para>Specifies the minimum length command to save in PSReadline history. Note that PSReadline history is separate from PowerShell history. </maml:para>
549-
</maml:description>
550-
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
551-
<dev:type>
552-
<maml:name>Int32</maml:name>
553-
<maml:uri/>
554-
</dev:type>
555-
<dev:defaultValue>3</dev:defaultValue>
556-
</command:parameter>
557656
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
558657
<maml:name>MaximumHistoryCount</maml:name>
559658
<maml:description>
560-
<maml:para>Specifies the maximum number of commands to save in PSReadline history. Note that PSReadline history is separate from PowerShell history. </maml:para>
659+
<maml:para>Specifies the maximum number of commands to save in PSReadline history. Note that PSReadline history is separate from PowerShell history.</maml:para>
561660
</maml:description>
562661
<command:parameterValue required="true" variableLength="false">Int32</command:parameterValue>
563662
<dev:type>
@@ -686,6 +785,18 @@
686785
</dev:type>
687786
<dev:defaultValue></dev:defaultValue>
688787
</command:parameter>
788+
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
789+
<maml:name>MinimumHistoryCommandLength</maml:name>
790+
<maml:description>
791+
<maml:para>Specifies the minimum length command to save in PSReadline history. Note that PSReadline history is separate from PowerShell history.</maml:para>
792+
</maml:description>
793+
<command:parameterValue required="true" variableLength="false">int32</command:parameterValue>
794+
<dev:type>
795+
<maml:name>int32</maml:name>
796+
<maml:uri/>
797+
</dev:type>
798+
<dev:defaultValue>3</dev:defaultValue>
799+
</command:parameter>
689800
</command:parameters>
690801
<command:inputTypes>
691802
<command:inputType>
@@ -724,4 +835,4 @@
724835
<maml:relatedLinks>
725836
</maml:relatedLinks>
726837
</command:command>
727-
</helpItems>
838+
</helpItems>

0 commit comments

Comments
 (0)