Often we forget what code we need to use to create a new line (line break), hopefully this will help.
- n = CR (Carriage Return)
- Used as a new line character in Unix
- r = LF (Line Feed)
- Used as a new line character in Mac OS
- nr = CR + LF
- Used as a new line character in Windows
- (char)13 = n = CR
- Same as n
- Environment.NewLine
- Any of the above code based on the operating system
Write-Output "`r`nLine 1" Write-Output "`r`nLine 2" Write-Output "`r`nLine 3"
Wikipedia Reference: http://en.wikipedia.org/wiki/Newline
Originally Posted on March 4, 2013
Last Updated on March 10, 2016
Last Updated on March 10, 2016
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.