---
title: "Concatenate-Files"
---
Concatenates files on a server.
Concatenate-Files(
File: <text>,
[Directory: <text>],
[Include: <@(text)>],
[Exclude: <@(text)>],
[Encoding: <text>],
[Separator: <text>]
);
This operation may be prefixed with Files::
, although this is a built-in namespace and isn't really necessary.
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
☆ Output file | text | File | This argument is required. |
Directory | text | Directory | Value note: "$WorkingDirectory". |
Include | @(text) | Include | See KB#1119 to learn more about masking syntax. Value note: "* (top-level items)". |
Exclude | @(text) | Exclude | See KB#1119 to learn more about masking syntax. |
Encoding | text | Encoding | Value note: "utf8". |
Separator | text | Separator |
# concatenates all SQL files in the working directory into a
# single file, each script separated by a GO statement
Concatenate-Files(
File: all.sql,
Include: *.sql,
Separator: >>
GO
>>
);