Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed formatting on expanded example #1861

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 29 additions & 42 deletions reference/5.1/Microsoft.PowerShell.Core/About/about_pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,59 +67,46 @@ This pipeline is comprised of four commands in the specified order. The command
is written horizontally, but we will show the process vertically in the following
graphic.

`Get-ChildItem` `-Path` *.txt

**|**

| (FileInfo objects )
| ( .txt )

**|**

**V**

`Where-Object` {$_.length `-gt` 10000}

**|**

| (FileInfo objects )
| ( .txt )
| ( Length > 10000 )

**|**

**V**

```powershell
Get-ChildItem -Path '*.txt'

`Sort-Object` `-Property` Length
|
| ( FileInfo objects )
| ( .txt )
|
V

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, the above should probably be in a plain codeblock (no powershell language indicator) so the ASCII art doesn't get syntax highlighted? but then you would need to alternate between PS code blocks and plain code blocks? or just have the entire thing in plain codeblocks...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another solution I thought of in hindsight, having a code block in one example, and another below that code block with the object types of the pipeline (instead of the commands)

**|**
Where-Object { $_.Length -gt 10000 }

| (FileInfo objects )
|
| ( FileInfo objects )
| ( .txt )
| ( Length > 10000 )
| ( Sorted by length )

**|**

**V**
|
V

Sort-Object -Property 'Length'

`Format-Table` `-Property` name, length

**|**
|
| ( FileInfo objects )
| ( .txt )
| ( Length > 10000 )
| ( Sorted by length )
|
V

| (FileInfo objects )
| ( .txt )
| ( Length > 10000 )
| ( Sorted by length )
| (Formatted in a table )
Format-Table -Property @('Name', 'Length')

**|**
|
| ( FileInfo objects )
| ( .txt )
| ( Length > 10000 )
| ( Sorted by length )
| ( Formatted in a table )
|
V

**V**

```
Name Length
---- ------
tmp1.txt 82920
Expand Down