Out-File, Add-Content, and Set-Content now have a new –NoNewline switch which simply omits a new line after the output.
PS C:\> "This is " | Out-File -FilePath Example.txt -NoNewline
PS C:\>; "a single " | Add-Content -Path Example.txt -NoNewline
PS C:\> "sentence." | Add-Content -Path Example.txt -NoNewline
PS C:\> Get-Content .\Example.txt
This is a single sentence.
Without –NoNewline specified, each fragment would be on a separate line:
PS C:\> "This is " | Out-File -FilePath Example.txt
PS C:\> "a single " | Add-Content -Path Example.txt
PS C:\> "sentence." | Add-Content -Path Example.txt
PS C:\> Get-Content .\Example.txt
This is
a single
sentence.