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.