PowerShell for Windows Admins

Apr 8 2012   7:54AM GMT

Scripting Games 2012 Comments: #1 Line Continuation

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

As with previous games I’ll publish a series of comments on the games. I won’t deal with any event specific issues until the games events are all closed but there are some things coming through that while not affecting any gradings don’t make the best use of PowerShell.

The first one that’s jumped out is line continuation.

I’ve seen a number of examples like the following two

get-service | `
sort status  -Descending


get-service  `
| sort status  -Descending

Both work but the line continuation character is unnecessary

All you need to do is

get-service |
sort status  -Descending

The pipeline symbol also works as a line continuation.

A minor point maybe but let PowerShell do the work for you

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: