How do I concatenate two text files in PowerShell?

前端 未结 11 1970
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 03:17

I am trying to replicate the functionality of the cat command in Unix.

I would like to avoid solutions where I explicitly read both files into variables

11条回答
  •  星月不相逢
    2020-11-28 03:47

    To keep encoding and line endings:

    Get-Content files.* -Raw | Set-Content newfile.file -NoNewline
    

    Note: AFAIR, whose parameters aren't supported by old Powershells (<3? <4?)

提交回复
热议问题