Relative Content

Tag Archive for powershellline-breaks

Why Do Some Powershell Scripts Need `n` For New Text Lines

I have spent the last few months make PowerShell scripts to do various custom tasks. Recently I have seen an issue where some Powershell scripts when I use Write-Host lines, for new lines to show up in the output, I have to use the "n”at the end of each line withinWrite-Host. Other scripts I don't have to do this. I can't find a lot of information on this as to why it wants me to do this as other scripts I write I don't have to use this tag. In other scripts I can use just a normal line break within the Write-Hostblock and it will make a line break. In some it won't make the line break without then".