Remove-MapiFolder

Description

Deletes a folder from the message store.

Syntax

Note: Parameters in orange are optional.

Remove-MapiFolder
-StoreMapiObject<Mapi.NET.Store>
FolderIDMapiObject<Mapi.NET.EntryID>

Remove-MapiFolder
-StoreMapiObject<Mapi.NET.Store>
-FolderPathString
-PathDelimiterString (default is '/')

Remove-MapiFolder
-ParentFolderMapiObject<Mapi.NET.Folder>
-FolderNameString

 

Parameters

StoreA Mapi.NET.Store object in which the folder to be deleted exists
FolderPathA string value that is the folder path of the folder to be deleted.
PathDelimiterA string value that is used as a delimiter between folders in FolderPath.  The default value if this item is omitted is '/'
FolderIDA Mapi.NET.EntryID value that represents the folder to be deleted.
ParentFolderA Mapi.NET.Folder object that is the parent folder of FolderName
FolderNameThe name of the folder that is an immediate child of ParentFolder
 

Remarks

This cmdlet deletes the selected folder, including items and any subfolders of the selected folder.

Permanent deletion of a folder depends upon the message store, for example folders deleted from a PST store are permanent while folder in an Exchange store may have deleted retention policies in place.

This cmdlet does not return until all folders and items have been deleted; if the folder tree being deleted is very large, this process may take some time to complete. In interactive PowerShell sessions, a progress bar will be shown for large trees.

This cmdlet will prompt for confirmation unless -Confirm:$false is also used.