Skip to content

Commit a1f878c

Browse files
v2.33.0
1 parent e6e2da1 commit a1f878c

File tree

11 files changed

+83
-65
lines changed

11 files changed

+83
-65
lines changed

PSScriptToolsManual.pdf

366 KB
Binary file not shown.

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
[![PSGallery Version](https://img.shields.io/powershellgallery/v/PSScripttools.png?style=for-the-badge&logo=powershell&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/PSScripttools/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/PSScripttools.png?style=for-the-badge&label=Downloads)](https://www.powershellgallery.com/packages/PSScripttools/)
44

5-
This module contains a collection of functions, variables and format files that you can use to enhance your PowerShell scripting work, or get more done from a PowerShell prompt with less typing. Most of the commands are designed to work cross-platform. Please post any questions, problems, or feedback in [Issues](https://github.com/jdhitsolutions/PSScriptTools/issues). Any feedback is greatly appreciated.
5+
## Abstract
6+
7+
This module contains a collection of functions, variables, and format files that you can use to enhance your PowerShell scripting work, or get more done from a PowerShell prompt with less typing. Most of the commands are designed to work cross-platform. Please post any questions, problems, or feedback at [Issues](https://github.com/jdhitsolutions/PSScriptTools/issues). Any feedback is greatly appreciated.
8+
9+
The contents of this file and other documentation can be viewed using the `Open-PSScriptToolsHelp` command. You can also use `Get-PSScriptTools` to see a summary of module commands.
610

711
*Please note that code samples have been formatted to fit an 80 character width. Some example code breaks lines without using line continuation characters. I'm trusting that you can figure out how to run the example.*
812

@@ -41,9 +45,7 @@ Starting in v2.2.0, the module was restructured to better support `Desktop` and
4145

4246
It is recommended to install this module from the PowerShell Gallery and not GitHub.
4347

44-
### Uninstall the Module
45-
46-
To remove the module from your system you can uninstall it.
48+
To remove the module from your system you can easily uninstall it with common PowerShell commands.
4749

4850
```powershell
4951
Get-Module PSScriptTools | Remove-Module
@@ -1181,7 +1183,7 @@ Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
11811183
118 8 1580 7476 0.02 35668 0 svchost
11821184
```
11831185

1184-
These custom Select commands are not necessarily designed for peformance and there may be better ways to achieve the same results from these examples.
1186+
These custom Select commands are not necessarily designed for performance and there may be better ways to achieve the same results from these examples.
11851187

11861188
## Time Functions
11871189

@@ -1373,7 +1375,7 @@ Expect a period of trial and error to find a good font that works with your text
13731375

13741376
This command is intended for writers and those who need to document with PowerShell. You can pipe any command to this function and you will get the regular output in your PowerShell session.Simultaneously a copy of the output will be sent to the Windows clipboard. The copied output will include a prompt constructed from the current location unless you use the CommandOnly parameter.
13751377

1376-
You can run this a command like this:
1378+
You can run a command like this:
13771379

13781380
```powershell
13791381
Get-Process | Sort WS -Descending | Select -first 5 | Out-Copy
@@ -2177,4 +2179,4 @@ If you find this module useful, you might also want to look at my PowerShell too
21772179

21782180
Where possible these commands have been tested with PowerShell 7, but not every platform. If you encounter problems, have suggestions or other feedback, please post an [issue](https://github.com/jdhitsolutions/PSScriptTools/issues). It is assumed you will __not__ be running these commands on any edition of PowerShell Core or any beta releases of PowerShell 7.
21792181

2180-
Last Updated *2020-11-04 22:51:29Z*
2182+
Last Updated *2020-11-09 21:23:07Z*

docs/ConvertTo-Markdown.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ConvertTo-Markdown [[-Inputobject] <Object>] [-Title <String>]
2121

2222
## DESCRIPTION
2323

24-
This command is designed to accept pipelined output and create a markdown document. The pipeline output will formatted as a text block or you can specify a table. You can optionally define a title, content to appear before the output and content to appear after the output.
24+
This command is designed to accept pipelined output and create a generic markdown document. The pipeline output will formatted as a text block or you can specify a table. You can optionally define a title, content to appear before the output, and content to appear after the output. Best efforts have been made to produce markdown output that meets basic standards.
2525

2626
The command does not create a text file. You need to pipe results from this command to a cmdlet like Out-File or Set-Content. See examples.
2727

@@ -56,7 +56,7 @@ Convertto-Markdown -title "Service Check" -precontent "## $($env:computername)"`
5656
-postcontent "_report $(Get-Date)_" | Out-File c:\work\svc.md
5757
```
5858

59-
Re-run the previous command and save output to a file.
59+
Re-run the previous command and save the output to a file.
6060

6161
### EXAMPLE 3
6262

@@ -84,7 +84,7 @@ PS C:\>$out += ConvertTo-Markdown -PostContent $footer
8484
PS C:\>$out | Set-Content c:\work\report.md
8585
```
8686

87-
Here is an example that create a series of markdown fragments for each computer and at the end creates a markdown document.
87+
Here is an example that creates a series of markdown fragments for each computer and in the end creates a markdown document.
8888

8989
## PARAMETERS
9090

@@ -106,7 +106,7 @@ Accept wildcard characters: False
106106
107107
### -Title
108108
109-
Specify a top level title. You do not need to include any markdown.
109+
Specify a top-level title. You do not need to include any markdown.
110110
111111
```yaml
112112
Type: String

docs/Get-MyCounter.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Get all of the System counters with Get-Counter and pipe them to Get-MyCounter.
6060
### Example 2
6161

6262
```powershell
63-
PS C:\> Get-MyCounter -computername server18| Format-table -view category
63+
PS C:\> Get-MyCounter -computername server18 | Format-table -view category
6464
6565
6666
Category: network interface(intel[r] ethernet connection [11] i219-lm)
@@ -196,13 +196,13 @@ Gets data from the specified performance counters. Enter one or more counter pat
196196
197197
Each counter path has the following format:
198198
199-
"[\\<ComputerName>]\<CounterSet>(<Instance>)\<CounterName>"
199+
\\\\ComputerName\\CounterSet(Instance)\\CounterName
200200
201201
For example:
202202
203-
"\\Server01\Processor(2)\% User Time"
203+
\\\\Server01\\Processor(2)\\% User Time
204204
205-
The <ComputerName> element is optional. If you omit it, Get-MyCounter uses the value of the ComputerName parameter.
205+
The ComputerName element is optional. If you omit it, Get-MyCounter uses the value of the ComputerName parameter.
206206
207207
```yaml
208208
Type: String[]

docs/Open-PSScriptToolsHelp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Open-PSScriptToolsHelp [<CommonParameters>]
1919

2020
## DESCRIPTION
2121

22-
This command will launch a PDF manual for all commands in the PSScriptTools module. It is assumed you have a default application for PDF files.
22+
This command will launch a PDF manual for all commands in the PSScriptTools module. It is assumed you have a default application associated with PDF files.
2323

2424
## EXAMPLES
2525

docs/Out-Copy.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,24 @@ Out-Copy [-InputObject] <Object> [-Width <Int32>] [-CommandOnly]
2020

2121
## DESCRIPTION
2222

23-
This command is intended for writers and those who need to document with PowerShell.
24-
You can pipe any command to this function and you will get the regular output in your PowerShell session.
25-
Simultaneously a copy of the output will be sent to the Windows clipboard.
26-
The copied output will include a prompt constructed from the current location unless you use the CommandOnly parameter.
23+
This command is intended for writers and those who need to document with PowerShell. You can pipe any command to this function and you will get the regular output in your PowerShell session. Simultaneously, a copy of the output will be sent to the Windows clipboard. The copied output will include a prompt constructed from the current location unless you use the CommandOnly parameter.
2724

28-
NOTE: You can only capture what is written to the Success pipeline.
29-
This command will not copy any other streams such as Verbose, Warning, or Error.
25+
NOTE: You can only capture what is written to the Success pipeline. This command will not copy any other streams such as Verbose, Warning, or Error.
3026

3127
## EXAMPLES
3228

3329
### EXAMPLE 1
3430

3531
```powershell
36-
PS C:\> Get-Process | Sort WS -Descending | Select -first 5 | Out-Copy
32+
PS C:\> Get-Process | Sort WS -Descending | Select-First 5 | Out-Copy
3733
```
3834

3935
This will execute your expression and write the output to the pipeline.
4036
The output plus the command:
4137

4238
PS C:\\> Get-Process | Sort WS -Descending | Select -first 5
4339

44-
will be copied to the clipboard.
40+
will be copied to the clipboard. This example is using the Select-First function from the PSScriptTools module.
4541

4642
### EXAMPLE 2
4743

docs/Out-More.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Out-More [-InputObject] <Object[]> [[-Count] <Int32>] [-ClearScreen]
1919

2020
## DESCRIPTION
2121

22-
This function is designed to display groups or "pages" of objects to the PowerShell pipeline. It is modeled after the legacy More.com command line utility. By default the command will write out objects out to the pipeline in groups of 50. You will be prompted after each grouping.
22+
This function is designed to display groups or "pages" of objects to the PowerShell pipeline. It is modeled after the legacy More.com command-line utility. By default, the command will write objects out to the pipeline in groups of 50. You will be prompted after each grouping.
2323

2424
Pressing M or Enter will get the next group. Pressing A will stop paging and display all of the remaining objects. Pressing N will display the next object. Press Q to stop writing anything else to the pipeline.
2525

@@ -73,7 +73,7 @@ Accept wildcard characters: False
7373
7474
### -Count
7575
76-
The number of objects to group together in a page.
76+
The number of objects to group as a page.
7777
7878
```yaml
7979
Type: Int32
@@ -89,7 +89,7 @@ Accept wildcard characters: False
8989
9090
### -ClearScreen
9191
92-
Clear the screen prior to writing data to the pipeline.
92+
Clear the screen before writing data to the pipeline.
9393
9494
```yaml
9595
Type: SwitchParameter

docs/Write-Detail.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Write-Detail [[-Message] <String>] [-Prefix <String>] [-Date]
3535

3636
## DESCRIPTION
3737

38-
This command is designed to be used within your functions and scripts to make it easier to write a detailed message that you can use as verbose output. The assumption is that you are using an advanced function with a Begin, Process and End scriptblocks. You can create a detailed message to indicate what part of the code is being executed. The output can include a full time stamp, or a time string which includes a millisecond value.
38+
This command is designed to be used within your functions and scripts to make it easier to write a detailed message that you can use as verbose output. The assumption is that you are using an advanced function with Begin, Process and End scriptblocks. You can create a detailed message to indicate what part of the code is being executed. The output can include a full-time stamp, or a time string which includes a millisecond value.
3939

4040
In a script you might use it like this in a Begin block:
4141

en-us/PSScriptTools-help.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ Thursday, March 14, 2019 4:00:00 PM</dev:code>
24452445
</maml:description>
24462446
</command:details>
24472447
<maml:description>
2448-
<maml:para>This command is designed to accept pipelined output and create a markdown document. The pipeline output will formatted as a text block or you can specify a table. You can optionally define a title, content to appear before the output and content to appear after the output.</maml:para>
2448+
<maml:para>This command is designed to accept pipelined output and create a generic markdown document. The pipeline output will formatted as a text block or you can specify a table. You can optionally define a title, content to appear before the output, and content to appear after the output. Best efforts have been made to produce markdown output that meets basic standards.</maml:para>
24492449
<maml:para>The command does not create a text file. You need to pipe results from this command to a cmdlet like Out-File or Set-Content. See examples.</maml:para>
24502450
</maml:description>
24512451
<command:syntax>
@@ -2466,7 +2466,7 @@ Thursday, March 14, 2019 4:00:00 PM</dev:code>
24662466
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
24672467
<maml:name>Title</maml:name>
24682468
<maml:Description>
2469-
<maml:para>Specify a top level title. You do not need to include any markdown.</maml:para>
2469+
<maml:para>Specify a top-level title. You do not need to include any markdown.</maml:para>
24702470
</maml:Description>
24712471
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
24722472
<dev:type>
@@ -2540,7 +2540,7 @@ Thursday, March 14, 2019 4:00:00 PM</dev:code>
25402540
<command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none">
25412541
<maml:name>Title</maml:name>
25422542
<maml:Description>
2543-
<maml:para>Specify a top level title. You do not need to include any markdown.</maml:para>
2543+
<maml:para>Specify a top-level title. You do not need to include any markdown.</maml:para>
25442544
</maml:Description>
25452545
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
25462546
<dev:type>
@@ -2650,7 +2650,7 @@ Running Winrm Windows Remote Management (WS-Manag...
26502650
Convertto-Markdown -title "Service Check" -precontent "## $($env:computername)"`
26512651
-postcontent "_report $(Get-Date)_" | Out-File c:\work\svc.md</dev:code>
26522652
<dev:remarks>
2653-
<maml:para>Re-run the previous command and save output to a file.</maml:para>
2653+
<maml:para>Re-run the previous command and save the output to a file.</maml:para>
26542654
</dev:remarks>
26552655
</command:example>
26562656
<command:example>
@@ -2677,7 +2677,7 @@ ConvertTo-Markdown -PreContent "## $($computer.toUpper())"
26772677
PS C:\&gt;$out += ConvertTo-Markdown -PostContent $footer
26782678
PS C:\&gt;$out | Set-Content c:\work\report.md</dev:code>
26792679
<dev:remarks>
2680-
<maml:para>Here is an example that create a series of markdown fragments for each computer and at the end creates a markdown document.</maml:para>
2680+
<maml:para>Here is an example that creates a series of markdown fragments for each computer and in the end creates a markdown document.</maml:para>
26812681
</dev:remarks>
26822682
</command:example>
26832683
</command:examples>
@@ -6111,10 +6111,10 @@ np notepad ReadOnly</dev:code>
61116111
<maml:Description>
61126112
<maml:para>Gets data from the specified performance counters. Enter one or more counter paths. Wildcards are permitted only in the Instance value. You can also pipe counter path strings to Get-MyCounter.</maml:para>
61136113
<maml:para> Each counter path has the following format:</maml:para>
6114-
<maml:para>"[\&lt;ComputerName&gt;]&lt;CounterSet&gt;(&lt;Instance&gt;)&lt;CounterName&gt;"</maml:para>
6114+
<maml:para>\\ComputerName\CounterSet(Instance)\CounterName</maml:para>
61156115
<maml:para>For example:</maml:para>
6116-
<maml:para>"\Server01\Processor(2)\% User Time"</maml:para>
6117-
<maml:para>The &lt;ComputerName&gt; element is optional. If you omit it, Get-MyCounter uses the value of the ComputerName parameter.</maml:para>
6116+
<maml:para>\\Server01\Processor(2)\% User Time</maml:para>
6117+
<maml:para>The ComputerName element is optional. If you omit it, Get-MyCounter uses the value of the ComputerName parameter.</maml:para>
61186118
</maml:Description>
61196119
<command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
61206120
<dev:type>
@@ -6202,10 +6202,10 @@ np notepad ReadOnly</dev:code>
62026202
<maml:Description>
62036203
<maml:para>Gets data from the specified performance counters. Enter one or more counter paths. Wildcards are permitted only in the Instance value. You can also pipe counter path strings to Get-MyCounter.</maml:para>
62046204
<maml:para> Each counter path has the following format:</maml:para>
6205-
<maml:para>"[\&lt;ComputerName&gt;]&lt;CounterSet&gt;(&lt;Instance&gt;)&lt;CounterName&gt;"</maml:para>
6205+
<maml:para>\\ComputerName\CounterSet(Instance)\CounterName</maml:para>
62066206
<maml:para>For example:</maml:para>
6207-
<maml:para>"\Server01\Processor(2)\% User Time"</maml:para>
6208-
<maml:para>The &lt;ComputerName&gt; element is optional. If you omit it, Get-MyCounter uses the value of the ComputerName parameter.</maml:para>
6207+
<maml:para>\\Server01\Processor(2)\% User Time</maml:para>
6208+
<maml:para>The ComputerName element is optional. If you omit it, Get-MyCounter uses the value of the ComputerName parameter.</maml:para>
62096209
</maml:Description>
62106210
<command:parameterValue required="true" variableLength="false">String[]</command:parameterValue>
62116211
<dev:type>
@@ -6296,7 +6296,7 @@ Timestamp Category Counter Value
62966296
</command:example>
62976297
<command:example>
62986298
<maml:title>-------------------------- Example 2 --------------------------</maml:title>
6299-
<dev:code>PS C:\&gt; Get-MyCounter -computername server18| Format-table -view category
6299+
<dev:code>PS C:\&gt; Get-MyCounter -computername server18 | Format-table -view category
63006300

63016301

63026302
Category: network interface(intel[r] ethernet connection [11] i219-lm)
@@ -11932,7 +11932,7 @@ Out-Copy -commandonly</dev:code>
1193211932
</maml:description>
1193311933
</command:details>
1193411934
<maml:description>
11935-
<maml:para>This function is designed to display groups or "pages" of objects to the PowerShell pipeline. It is modeled after the legacy More.com command line utility. By default the command will write out objects out to the pipeline in groups of 50. You will be prompted after each grouping.</maml:para>
11935+
<maml:para>This function is designed to display groups or "pages" of objects to the PowerShell pipeline. It is modeled after the legacy More.com command-line utility. By default, the command will write objects out to the pipeline in groups of 50. You will be prompted after each grouping.</maml:para>
1193611936
<maml:para>Pressing M or Enter will get the next group. Pressing A will stop paging and display all of the remaining objects. Pressing N will display the next object. Press Q to stop writing anything else to the pipeline.</maml:para>
1193711937
<maml:para>Note that you may encounter an error message when quitting prematurely, especially on non-Windows platforms. You can ignore these errors.</maml:para>
1193811938
</maml:description>
@@ -16311,7 +16311,7 @@ PS C:\&gt; Invoke-Command -scriptblock $sb</dev:code>
1631116311
</maml:description>
1631216312
</command:details>
1631316313
<maml:description>
16314-
<maml:para>This command is designed to be used within your functions and scripts to make it easier to write a detailed message that you can use as verbose output. The assumption is that you are using an advanced function with a Begin, Process and End scriptblocks. You can create a detailed message to indicate what part of the code is being executed. The output can include a full time stamp, or a time string which includes a millisecond value.</maml:para>
16314+
<maml:para>This command is designed to be used within your functions and scripts to make it easier to write a detailed message that you can use as verbose output. The assumption is that you are using an advanced function with Begin, Process and End scriptblocks. You can create a detailed message to indicate what part of the code is being executed. The output can include a full-time stamp, or a time string which includes a millisecond value.</maml:para>
1631516315
<maml:para>In a script you might use it like this in a Begin block:</maml:para>
1631616316
<maml:para> $pfx = "BEGIN"</maml:para>
1631716317
<maml:para> Write-Detail "Starting $($MyInvocation.MyCommand)" -Prefix $pfx | Write-Verbose</maml:para>

0 commit comments

Comments
 (0)