Powershell

Line Breaks in PowerShell Output

This article briefly introduces how to insert line breaks in PowerShell output. To insert line breaks in path output, we use CRLF instead of <code>\n</code>. <pre><code>PS C:\pg&gt; $Env:Path.replace...By the way, just because you've made it output line by line doesn't mean you can do this......

Shou Arisaka
1 min read
Nov 23, 2025

This article briefly introduces how to insert line breaks in PowerShell output.

To insert line breaks in path output, we use CRLF instead of \n.

PS C:\pg> $Env:Path.replace(';',"`r`n")
C:\Program Files\ConEmu\ConEmu\Scripts
C:\Program Files\ConEmu
C:\Program Files\ConEmu\ConEmu
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin

I’m not used to this.

By the way, just because you’ve made it output line by line doesn’t mean you can do this.

PS C:\pg> $Env:Path.replace(';',"`r`n") | sls "ruby"

sls is a command like grep.

I’m currently investigating how to do this.

Share this article

Shou Arisaka Nov 23, 2025

🔗 Copy Links