I know that there are different line-break codes in windows and unix. But in Powershell, both `r`n
and `n
work for a line break.
Is there an automatic conversion from `n
to `r`n
and why do you have to use quotes instead of backslashes?
If you're talking scripts, PowerShell will interpret both the \n
and \r\n
end-of-line (EOL) sequence equally when parsing. The \r\n
EOL is mostly a Windows artifact of the past, and most of the modern (ca. 2018) Windows apps released will interpret them the same.
Those are not quotes, but grave accents or backticks (the tilde key on most keyboards) and they are the designated string escape character in PowerShell.
One thing that does impact parsing of a Windows PowerShell script is the use of a Byte Order Mark (BOM). This is the only way to get the PowerShell interpreter to see unicode (such as emojis) in your code; that is, by using UTF8-BOM.