Copy-MapiFolder

Description

Copies a selected folder to another parent folder.

Syntax

Note: Parameters in orange are optional.

Copy-MapiFolder
-StoreMapiObject<Mapi.NET.Store>
-SourceFolderPathString
-DestinationFolderPathString
-CopySubfoldersSwitchParameter
-PathDelimiterString

Copy-MapiFolder
-SourceFolderMapiObject<Mapi.NET.Folder>
-DestinationFolderMapiObject<Mapi.NET.Folder>
-CopySubfoldersSwitchParameter

Parameters

StoreA Mapi.NET.Store object that represents the message store in which the folder paths reference.  Note: to copy a folder to a different message store, use the SourceFolder/DestinationFolder pattern.
SourceFolderA Mapi.NET.Folder object that represents the source folder to be copied.
DestinationFolderA Mapi.NET.Folder object that represents the target parent folder under which the SourceFolder will be copied.
SourceFolderPathA string that is the full folder path for the source folder, relative to the message store provided in the Store parameter.
DestinationFolderPathA string that is the full folder path for the target parent folder, under which the folder will be copied.  The path must be relative to the message store provided.
CopySubFoldersAn optional SwitchParameter, which when present will also copy the subfolders to the target parent folder.
PathDelimiterAn optional SwitchParameter, which when present defines the path delimiter used in the SourceFolderPath and DestinationFolderPath parameters.  The default path delimiter is a /" character.

Remarks

This cmdlet copies a folder, its contents, and optionally its children folders, to another folder.

This operation does not merge with an existing folder with the same name.  If the target parent folder already has a folder with the same name as the source folder, it will fail to copy.

A folder copy operation can take considerable time depending upon the total number of items that have to be copied with the folder.  When running PowerShell in an interactive host, a progress indicator is presented.  If CTRL+C is used to break the operation, a few messages may still copy in the background before the call is canceled and an error message will be written to the console.