Line break after an operator

It is possible to add a line break after any of the operators. The most useful place for a line break is often after a logic operator is used to combine several comparisons, for example:

Get-Service | Where-Object {
$_.Status -eq 'Running' -and
$_.StartType -eq 'Manual'
}

One of the less obvious operators is the property dereference operator, .. A line break may be added after calling a method of accessing a property. This is shown in the following example:

{ A long string in a script block }.ToString().
SubString(0, 15).
Trim().
Length
..................Content has been hidden....................

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