Skip to content

Commit 7a4071f

Browse files
v2.23.0
1 parent 75df253 commit 7a4071f

12 files changed

+334
-157
lines changed

PSScriptTools.psd1

0 Bytes
Binary file not shown.

README.md

Lines changed: 28 additions & 58 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log for PSScriptTools
22

3+
## v2.23.0
4+
5+
+ Updated `New-PSFormatXML` to include an option to wrap tables. (Issue #78)
6+
+ Updated `Add-Border` to include parameters to specify an ANSI sequence for the border and one for the text.
7+
+ Revised `Add-Border` to better support inserting blank lines.
8+
+ Updated `README.md`
9+
310
## v2.22.0
411

512
+ Modified `Set-ConsoleTitle` to move parameter validation into the `Process` script block. (Issue #75)

docs/Add-Border.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ Create a text border around a string.
1616
### single (Default)
1717

1818
```yaml
19-
Add-Border [-Text] <String> [-Character <String>] [-InsertBlanks] [-Tab <Int32>] [<CommonParameters>]
19+
Add-Border [-Text] <String> [-Character <String>] [-InsertBlanks] [-Tab <Int32>] [-ANSIBorder <String>]
20+
[-ANSIText <String>] [<CommonParameters>]
2021
```
2122

2223
### block
2324

2425
```yaml
25-
Add-Border [-TextBlock] <String[]> [-Character <String>] [-InsertBlanks] [-Tab <Int32>] [<CommonParameters>]
26+
Add-Border [-TextBlock] <String[]> [-Character <String>] [-InsertBlanks] [-Tab <Int32>] [-ANSIBorder <String>]
27+
[-ANSIText <String>] [<CommonParameters>]
2628
```
2729

2830
## DESCRIPTION
@@ -82,6 +84,20 @@ PS C:\> add-border -textblock (get-service win* | out-string).trim()
8284

8385
Create a border around the output of a Get-Service command.
8486

87+
### EXAMPLE 5
88+
89+
```powershell
90+
PS C:\> add-border -Text $t -ANSIBorder "$([char]0x1b)[38;5;47m" -ANSIText "$([char]0x1b)[93m" -InsertBlanks
91+
92+
*******************
93+
* *
94+
* I am the walrus *
95+
* *
96+
*******************
97+
```
98+
99+
This will write a color version of the text and border. You would this type of ANSI syntax for Windows PowerShell. In PowerShell 7, you can use the same syntax or the much easier "`e[38;5;47m".
100+
85101
## PARAMETERS
86102

87103
### -Text
@@ -164,9 +180,41 @@ Accept pipeline input: False
164180
Accept wildcard characters: False
165181
```
166182
183+
### -ANSIBorder
184+
185+
Enter an ANSI escape sequence to color the border characters.
186+
187+
```yaml
188+
Type: String
189+
Parameter Sets: (All)
190+
Aliases:
191+
192+
Required: False
193+
Position: Named
194+
Default value: None
195+
Accept pipeline input: False
196+
Accept wildcard characters: False
197+
```
198+
199+
### -ANSIText
200+
201+
Enter an ANSI escape sequence to color the text.
202+
203+
```yaml
204+
Type: String
205+
Parameter Sets: (All)
206+
Aliases:
207+
208+
Required: False
209+
Position: Named
210+
Default value: None
211+
Accept pipeline input: False
212+
Accept wildcard characters: False
213+
```
214+
167215
### CommonParameters
168216
169-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
217+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
170218
171219
## INPUTS
172220

docs/New-PSFormatXML.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Create or modify a format.ps1xml file.
1515

1616
```yaml
1717
New-PSFormatXML [-InputObject] <Object> [[-Properties] <String[]>] [-Typename <String>]
18-
[[-FormatType] <String>] [[-ViewName] <String>] [-Path] <String> [-GroupBy <String>] [-Append] [-Passthru]
19-
[-WhatIf] [-Confirm] [<CommonParameters>]
18+
[[-FormatType] <String>] [[-ViewName] <String>] [-Path] <String> [-GroupBy <String>] [-Wrap] [-Append]
19+
[-Passthru] [-WhatIf] [-Confirm] [<CommonParameters>]
2020
```
2121

2222
## DESCRIPTION
@@ -123,10 +123,7 @@ Get-Service | Sort-Object Status | Format-Wide -view Status
123123

124124
### -Append
125125

126-
Append the new view to an existing format.ps1xml file.
127-
You need to make sure that view names are unique.
128-
With the exception of default.
129-
You can have multiple default views as long as they are different types, such as table and list.
126+
Append the new view to an existing format.ps1xml file. You need to make sure that view names are unique. With the exception of default. You can have multiple default views as long as they are different types, such as table and list.
130127

131128
```yaml
132129
Type: SwitchParameter
@@ -223,9 +220,7 @@ Accept wildcard characters: False
223220
224221
### -Properties
225222
226-
Enter a set of properties to include.
227-
If you don't specify anything then all properties will be used.
228-
When creating a Wide view you should only specify a single property.
223+
Enter a set of properties to include. If you don't specify anything then all properties will be used. When creating a Wide view you should only specify a single property.
229224
230225
```yaml
231226
Type: String[]
@@ -303,6 +298,22 @@ Accept pipeline input: False
303298
Accept wildcard characters: False
304299
```
305300
301+
### -Wrap
302+
303+
Wrap long lines. This only applies to Tables.
304+
305+
```yaml
306+
Type: SwitchParameter
307+
Parameter Sets: (All)
308+
Aliases:
309+
310+
Required: False
311+
Position: Named
312+
Default value: None
313+
Accept pipeline input: False
314+
Accept wildcard characters: False
315+
```
316+
306317
### CommonParameters
307318
308319
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

en-us/PSScriptTools-help.xml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@
6262
</dev:type>
6363
<dev:defaultValue>0</dev:defaultValue>
6464
</command:parameter>
65+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
66+
<maml:name>ANSIBorder</maml:name>
67+
<maml:Description>
68+
<maml:para>Enter an ANSI escape sequence to color the border characters.</maml:para>
69+
</maml:Description>
70+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
71+
<dev:type>
72+
<maml:name>String</maml:name>
73+
<maml:uri />
74+
</dev:type>
75+
<dev:defaultValue>None</dev:defaultValue>
76+
</command:parameter>
77+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
78+
<maml:name>ANSIText</maml:name>
79+
<maml:Description>
80+
<maml:para>Enter an ANSI escape sequence to color the text.</maml:para>
81+
</maml:Description>
82+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
83+
<dev:type>
84+
<maml:name>String</maml:name>
85+
<maml:uri />
86+
</dev:type>
87+
<dev:defaultValue>None</dev:defaultValue>
88+
</command:parameter>
6589
</command:syntaxItem>
6690
<command:syntaxItem>
6791
<maml:name>Add-Border</maml:name>
@@ -112,6 +136,30 @@
112136
</dev:type>
113137
<dev:defaultValue>0</dev:defaultValue>
114138
</command:parameter>
139+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
140+
<maml:name>ANSIBorder</maml:name>
141+
<maml:Description>
142+
<maml:para>Enter an ANSI escape sequence to color the border characters.</maml:para>
143+
</maml:Description>
144+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
145+
<dev:type>
146+
<maml:name>String</maml:name>
147+
<maml:uri />
148+
</dev:type>
149+
<dev:defaultValue>None</dev:defaultValue>
150+
</command:parameter>
151+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
152+
<maml:name>ANSIText</maml:name>
153+
<maml:Description>
154+
<maml:para>Enter an ANSI escape sequence to color the text.</maml:para>
155+
</maml:Description>
156+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
157+
<dev:type>
158+
<maml:name>String</maml:name>
159+
<maml:uri />
160+
</dev:type>
161+
<dev:defaultValue>None</dev:defaultValue>
162+
</command:parameter>
115163
</command:syntaxItem>
116164
</command:syntax>
117165
<command:parameters>
@@ -175,6 +223,30 @@
175223
</dev:type>
176224
<dev:defaultValue>0</dev:defaultValue>
177225
</command:parameter>
226+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
227+
<maml:name>ANSIBorder</maml:name>
228+
<maml:Description>
229+
<maml:para>Enter an ANSI escape sequence to color the border characters.</maml:para>
230+
</maml:Description>
231+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
232+
<dev:type>
233+
<maml:name>String</maml:name>
234+
<maml:uri />
235+
</dev:type>
236+
<dev:defaultValue>None</dev:defaultValue>
237+
</command:parameter>
238+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
239+
<maml:name>ANSIText</maml:name>
240+
<maml:Description>
241+
<maml:para>Enter an ANSI escape sequence to color the text.</maml:para>
242+
</maml:Description>
243+
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
244+
<dev:type>
245+
<maml:name>String</maml:name>
246+
<maml:uri />
247+
</dev:type>
248+
<dev:defaultValue>None</dev:defaultValue>
249+
</command:parameter>
178250
</command:parameters>
179251
<command:inputTypes>
180252
<command:inputType>
@@ -253,6 +325,19 @@
253325
<maml:para>Create a border around the output of a Get-Service command.</maml:para>
254326
</dev:remarks>
255327
</command:example>
328+
<command:example>
329+
<maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title>
330+
<dev:code>PS C:\&gt; add-border -Text $t -ANSIBorder "$([char]0x1b)[38;5;47m" -ANSIText "$([char]0x1b)[93m" -InsertBlanks
331+
332+
*******************
333+
* *
334+
* I am the walrus *
335+
* *
336+
*******************</dev:code>
337+
<dev:remarks>
338+
<maml:para>This will write a color version of the text and border. You would this type of ANSI syntax for Windows PowerShell. In PowerShell 7, you can use the same syntax or the much easier "`e[38;5;47m".</maml:para>
339+
</dev:remarks>
340+
</command:example>
256341
</command:examples>
257342
<command:relatedLinks>
258343
<maml:navigationLink>
@@ -7824,6 +7909,17 @@ PS DeepDive:\&gt;</dev:code>
78247909
</dev:type>
78257910
<dev:defaultValue>None</dev:defaultValue>
78267911
</command:parameter>
7912+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
7913+
<maml:name>Wrap</maml:name>
7914+
<maml:Description>
7915+
<maml:para>Wrap long lines. This only applies to Tables.</maml:para>
7916+
</maml:Description>
7917+
<dev:type>
7918+
<maml:name>SwitchParameter</maml:name>
7919+
<maml:uri />
7920+
</dev:type>
7921+
<dev:defaultValue>False</dev:defaultValue>
7922+
</command:parameter>
78277923
</command:syntaxItem>
78287924
</command:syntax>
78297925
<command:parameters>
@@ -7959,6 +8055,18 @@ PS DeepDive:\&gt;</dev:code>
79598055
</dev:type>
79608056
<dev:defaultValue>None</dev:defaultValue>
79618057
</command:parameter>
8058+
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
8059+
<maml:name>Wrap</maml:name>
8060+
<maml:Description>
8061+
<maml:para>Wrap long lines. This only applies to Tables.</maml:para>
8062+
</maml:Description>
8063+
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
8064+
<dev:type>
8065+
<maml:name>SwitchParameter</maml:name>
8066+
<maml:uri />
8067+
</dev:type>
8068+
<dev:defaultValue>False</dev:defaultValue>
8069+
</command:parameter>
79628070
</command:parameters>
79638071
<command:inputTypes>
79648072
<command:inputType>

0 commit comments

Comments
 (0)