Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell script to copy mutliple files into a single file

PS C:	emp> $mergeFile = "c:	empmerged.file" # path/name of your merge file
PS C:	emp> Get-ChildItem -Filter *.txt | foreach { 
  $_.fullname | out-file $mergeFile -Append # append current file name to merge file
  get-content $_.fullname | out-file $mergeFile -Append # append current file content}
Source by social.technet.microsoft.com #
 
PREVIOUS NEXT
Tagged: #powershell #script #copy #mutliple #files #single #file
ADD COMMENT
Topic
Name
7+9 =