I needed something similar, Chris Berry's message helped, but I think it is more efficient:
gci -name "*PathToFiles*" | gc > master.sql
The first part gci -name "*PathToFiles*"will bring you a list of files. This can be done using wildcards to just get your .sql files, i.e.gci -name "\\share\folder\*.sql"
Then it connects to Get-Content and redirects the output to the master.sql file. As Kieth Hill noted, you can use Out-File instead of> to better control your output if necessary.
source
share