Line break after pipe

The most obvious technique is perhaps to add a line break after a pipe, for example:

Get-Process |
Where-Object Name -match 'po?w(er)?sh(ell)?'

This is useful for long pipelines, but may be counterproductive for short pipelines. For example, the following short pipeline ends with ForEach-Object. The statement is not necessarily long enough to need extra line breaks:

Get-Service | Where-Object Status -eq Running | ForEach-Object {
# Do work on the service
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.86.138