powershell, concatenate text files in a directory

posted 2/5/2015 2:44:43 AM by: timothy
$invocation = (Get-Variable MyInvocation).Value
$directorypath = Split-Path $invocation.MyCommand.Path
$files = $directoryPath + '\*'
$outFile = $directoryPath + '\AllTextInOneFile.txt'
ls $files -include *.txt, *.otherExtension | gc | out-file $outFile

© 1999—2024 Timothy Lee Russell

vcard

View Timothy Russell's profile on LinkedIn

profile for Timothy Lee Russell at Stack Overflow, Q&A for professional and enthusiast programmers