NoNewLine 매개 변수NoNewLine parameter

Out-File, Add-ContentSet-Content는 단순히 출력 뒤에 오는 새 줄을 생략하는 새로운 –NoNewline 스위치를 제공합니다.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.

–NoNewline을 지정하지 않으면 각 조각이 별도의 줄에 있게 됩니다.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.