Use this cmdlet to create a new FolderFilter object that can exclude folders from processing by path or pattern.
PowerShell | ParameterSet: "Path"
New-FolderExclusion
- -FolderPath
- [-PathDelimiter]
PowerShell | ParameterSet: "Pattern"
New-FolderExclusion
- -Pattern
Description
The New-FolderExclusion cmdlet creates a new FolderFilter object that causes Super-ExMerge to exclude folders from being processed.
When Super-ExMerge is processing folders, the path that is compared is the full path of the folder path excluding the initial parent path. For example, if the SyncTask were set to start in a source store at the following folder: \Inbox\Important Notes, an exclusion by folder path would look like: \From Robert. Since the source and target store could have different root folders defined, this simplifies the task of comparing folders by only looking at the common folder path segment between the two stores.
When using the -Pattern parameter, .NET Regular Expression pattern matching is used. This is the same pattern matching engine that is used by PowerShell’s -match operator.
SyncTask objects, by default, do not compare folders using TokenizedPaths. If this is desired, set the SyncTask.FolderExclusions.UseTokenizedPaths value to True. This value can be set by using the New-SyncTask or Set-SyncTask cmdlets.
Examples
Example 1
PowerShell
New-FolderExclusion -FolderPath '\Deleted Items'
This example will cause SuperExMerge to exclude any folder path that is or starts with \Deleted Items
Example 2
PowerShell
New-FolderExclusion -FolderPath '\{Inbox}\Old Mail'
This example will exclude any folder that is or starts with \{Inbox}\Old Mail. This example uses a TokenizedPath that will match the Inbox folder regardless of the language specific version of the folder name.
Example 3
PowerShell
New-FolderExclusion -FolderPath \{Inbox}\Sales\\Marketing
This example shows the used of a double\\blackslash in the folder path. When a folder’s name contains the folder delimiter character, doubling the character will allow the name to be used without confusing it as a delimiter.
Example 4
PowerShell
New-FolderExclusion -Pattern '(?:Inbox|Calendar|Tasks)'
This example uses the pattern matching option to exclude any folders that have the words Inbox, Calendar, or Tasks anywhere in the folder path. In this example both of these folder paths would be excluded: \{Inbox}\Invoices, \Templates\TaskScheduler. The reason the latter path is excluded is because the matching ignores character casing: \Template\TaskScheduler.
Parameters
-FolderPath
The FolderPath parameter specifies a full path that is to be excluded from processing. Note that all the matching folder and inherently all of its child folders are excluded from processing.
-PathDelimiter
The PathDelimiter parameter is used to specify a different folder path separator than the default value of a back\slash. This can be valuable for scripts where a backslash is seen as a reserved character.
-Pattern
The Pattern parameter is used to specify a .NET Regular Expression pattern that is compared to each folder path. Paths that match the pattern are excluded from processing.
Output
This cmdlet will place an instance of a FolderFilter object on the pipeline.
