![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | line continuation char My script has lines that are very long. In C# ";" acts as a statement terminator so statements can span lines. It seems in PowerShell that the ";" is optional. how do i break a line so that it is still legal syntax? $msg += Get-RM_DbsLastUse $server | Select dbName, LastTripDate | sort LastTripDate | Format-Table -AutoSize -Wrap | Out-String -Width 120; I want to add a "Where" to that as well. dan |
My System Specs![]() |
| | #2 (permalink) |
| | Re: line continuation char PowerShell will allow the statement to span lines if it detects an incomplete statement (for example, an unclosed set of parenthases, a trailing operator, etc.) or you can force it with a backtick at the end of the line. If you're building a big pipeline you can do: Command1 | Command2 | Command3 ` | Command4 etc... Josh "Dan Holmes" <dan.holmes@xxxxxx> wrote in message news:uSnx4ZNoJHA.1184@xxxxxx Quote: > My script has lines that are very long. In C# ";" acts as a statement > terminator so statements can span lines. It seems in PowerShell that the > ";" is optional. how do i break a line so that it is still legal syntax? > > $msg += Get-RM_DbsLastUse $server | Select dbName, LastTripDate | sort > LastTripDate | Format-Table -AutoSize -Wrap | Out-String -Width 120; > > I want to add a "Where" to that as well. > > dan |
My System Specs![]() |
| | #3 (permalink) |
| | Re: line continuation char The escape character is the backquote (sometimes called back tick). It is used for all escape sequences, including the end of the line. -- Charlie. http://msmvps.com/blogs/xperts64 http://mvp.support.microsoft.com/profile/charlie.russel "Dan Holmes" <dan.holmes@xxxxxx> wrote in message news:uSnx4ZNoJHA.1184@xxxxxx Quote: > My script has lines that are very long. In C# ";" acts as a statement > terminator so statements can span lines. It seems in PowerShell that the > ";" is optional. how do i break a line so that it is still legal syntax? > > $msg += Get-RM_DbsLastUse $server | Select dbName, LastTripDate | sort > LastTripDate | Format-Table -AutoSize -Wrap | Out-String -Width 120; > > I want to add a "Where" to that as well. > > dan |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| double char? | General Discussion | |||
| Re: Extracting the last char from the string | VB Script | |||
| continuing the continuation | Vista mail | |||
| Message - Too many continuation lines | .NET General | |||
| Continuation of video | Vista music pictures video | |||