Parâmetro NoNewLineNoNewLine parameter

Out-File, Add-Content e Set-Content agora têm uma nova opção –NoNewline, que simplesmente omite uma nova linha após a saída.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.

Sem –NoNewline especificado, cada fragmento ficaria em uma linha separada: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.