Cacomania: tag


Merging files together with the PowerShell

Guido Krömer - 2156 days ago - Tags: , ,

After playing a round with TypeScript, I needed a way for merging all those single files together. Performing this task with Bash is quite simple. Under Windows there is no Bash, but a thing called PowerShell. The PowerShell has got a large amount of Bash like aliases, which makes the move from Bash to PowerShel really simple, as you can see in the script below.

$TARGET_FILE = "Full.ts"


$FILES = ls -Recurse -Filter "*.ts"

foreach ($FILE in $FILES) {
  cat $file.FullName >> $TARGET_FILE