The problem is that there is no newline character at the end of the file, so it's just appending to the end of the line. There are two ways to go here. If it's just this one file that has this problem, you could just do this: $server = "`ntundra00" and then appending that to the file. If you just want to make sure that this doesn't happen, you can try sucking up the file into an array, adding $server to it, then outputting it to the file. $servers = Get-Content "$path\servernames.txt" $servers += $server $servers | out-file "$path\servernames.txt" The reason why you were seeing the spaces in between the letters is because your PowerShell is outputting 16-bit Unicode strings by default, so the output looks funky when injected into an 8-bit ascii-encoded file. In this case I didn't bother because I was overwriting the file anyway.
|