Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My lines are too long

Status
Not open for further replies.
Jun 13, 2013
7
0
0
I am new to powershell. when writing how do you continue to the next line in your editor or notepad.

For example:

$body="blah blah foo foo foo"

My goal is

$body="blah blah
foo foo"

I will need to continue this by not using words wrap so that no errors occur. How can I continue to the next line with out braeking the script? Should I use _ '

Thank you.
 
You could do that. You can also use herestrings

$body = @"
blah
blah
foo
foo
foo
"@

I've written some scripts that were more than 5,000 lines, and I still prefer single lines, with word wrap when needed.

Do you have your Tek-Tips.com Swag? I've got mine!

Stop by the new Tek-Tips group at LinkedIn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top