February 2019
Intermediate to advanced
626 pages
15h 51m
English
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}
Read now
Unlock full access