Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

New-OfficeEmailReaderOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Email.EmailReaderOptions

Creates bounded EML, MSG, and TNEF reader settings through ordinary PowerShell parameters.

Syntax

New-OfficeEmailReaderOptions
[-ExcludeAttachmentContent]
[-MaxAttachmentBytes <Int64>]
[-MaxAttachmentCount <Int32>]
[-MaxCompoundDirectoryEntries <Int32>]
[-MaxDecodedPropertyBytes <Int64>]
[-MaxHeaderBytes <Int32>]
[-MaxHeaderCount <Int32>]
[-MaxInputBytes <Int64>]
[-MaxMapiPropertyCount <Int32>]
[-MaxMimeDepth <Int32>]
[-MaxNestedMessageDepth <Int32>]
[-MaxPartCount <Int32>]
[-MaxTnefAttributeCount <Int32>]
[-MaxTotalAttachmentBytes <Int64>]
[-PreserveRawSource]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Read message diagnostics without retaining attachment payloads.

$options = New-OfficeEmailReaderOptions -ExcludeAttachmentContent -MaxAttachmentBytes 25MB
Get-OfficeEmail -Path .\Message.msg -Options $options -AsResult

Parameters

-ExcludeAttachmentContent SwitchParameter optional
Do not retain decoded attachment payloads in memory.
-MaxAttachmentBytes Int64 optional
Maximum decoded bytes for one attachment.
-MaxAttachmentCount Int32 optional
Maximum aggregate attachment count.
-MaxCompoundDirectoryEntries Int32 optional
Maximum CFB directory entries accepted while reading MSG.
-MaxDecodedPropertyBytes Int64 optional
Maximum aggregate bytes represented by decoded MSG property streams.
-MaxHeaderBytes Int32 optional
Maximum bytes allowed in one MIME header section.
-MaxHeaderCount Int32 optional
Maximum number of header fields in one entity.
-MaxInputBytes Int64 optional
Maximum artifact size accepted by the reader.
-MaxMapiPropertyCount Int32 optional
Maximum aggregate MAPI properties across a message and embedded messages.
-MaxMimeDepth Int32 optional
Maximum nested MIME depth.
-MaxNestedMessageDepth Int32 optional
Maximum embedded-message recursion depth.
-MaxPartCount Int32 optional
Maximum MIME entity count.
-MaxTnefAttributeCount Int32 optional
Maximum number of TNEF attributes.
-MaxTotalAttachmentBytes Int64 optional
Maximum aggregate decoded attachment bytes.
-PreserveRawSource SwitchParameter optional
Retain original artifact bytes for an explicit lossless write.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.