Get-MapiAttach

Description

This cmdlet retrieves an instance of a Mapi.NET.Attachment object from a Message.

Syntax

Note: Parameters in orange are optional.

Get-MapiAttach
-MessageMapiObject<Mapi.NET.Message>
-AttachNumInt32

Get-MapiAttach
-MessageMapiObject<Mapi.NET.Message>
-ListAllSwitchParameter

Get-MapiAttach
-MessageMapiObject<Mapi.NET.Message>
-ListVisibleSwitchParameter

Get-MapiAttach
-MessageMapiObject<Mapi.NET.Message>
-ListNonVisibleSwitchParameter

Parameters
MessageA Mapi.NET.Message object from which the specific attachment is desired
AttachNumAn Int32 value that is the specific attachment number from the list of attachments on the message (see remarks).
ListVisibleA switch parameter, which if present, forces the returned objects to only be those attachments that would be visible to a user
ListNonVisibleA switch parameter, which if present, forces the returned objects to only be those attachments that would not be visible to a user
ListAllA switch parameter, which if present, forces the returned objects to be all attachments, regardless of each's visible or non-visible state
Remarks

 

This cmdlet retrieves an attachment object from a message that can be used to get or set properties or to save the attachment data.

Attachments on a message are identified by their number, which is not necessarily in a contiguous numbering pattern and depends up on the message store's implementation.  Use this cmdlet without the AttachNum property or with the ListAll switch to retrieve a list of all attachments in order to view the attachment number for each attachment.

Note that most mapi message stores allow for "hidden" attachments.  For many HTML messages, with inline graphics, the images to be rendered in the body are stored as hidden attachments.  If the intent is to retrieve the list of "visible" attachments, use the ListVisible switch to return a list of visible attachments only.