1. Home
  2. Docs
  3. Super-ExMerge On-line Doc...
  4. PowerShell Cmdlet Referen...
  5. New-FolderExclusion

New-FolderExclusion

Use this cmdlet to create a new FolderFilter object that can exclude folders from processing by path or pattern.

New-FolderExclusion

  • -FolderPath
  • [-PathDelimiter]

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
      New-FolderExclusion -FolderPath '\Deleted Items'
    

    This example will cause SuperExMerge to exclude any folder path that is or starts with \Deleted Items

    Example 2
      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
      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
      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.

    Required:
    Yes
    Type:
    String
    Aliases:
    None
    Position:
    0
    Default Value:
    None

    -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.

    Required:
    No
    Type:
    String
    Aliases:
    None
    Position:
    1
    Default Value:
    ‘\’

    -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.

    Required:
    Yes
    Type:
    String
    Aliases:
    None
    Position:
    Not a positioned parameter. Use by name only.
    Default Value:
    None

    Output

    This cmdlet will place an instance of a FolderFilter object on the pipeline.

    How can we help?