Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Get-OfficeEmail

Namespace PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Email.EmailDocument OfficeIMO.Email.EmailReadResult OfficeIMO.Email.Store.EmailStoreReadResult

Reads a native EML, EMLX, MSG, or TNEF artifact with bounded diagnostics.

Remarks

Reads a native EML, EMLX, MSG, or TNEF artifact with bounded diagnostics.

Examples

Authored help example

Read a message without retaining attachment payloads.

PS>


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

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.

Syntax

Get-OfficeEmail [-AsResult] [-Options <EmailReaderOptions>] -Path <String> [-StoreOptions <EmailStoreReaderOptions>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AsResult SwitchParameter optionalposition: namedpipeline: False
Return the read result with diagnostics and consumed byte count.
Options EmailReaderOptions optionalposition: namedpipeline: False
Optional format detection, compound-file, MIME, attachment, and size limits.
Path String requiredposition: 0pipeline: True (ByValue)
Path to an EML, EMLX, MSG, TNEF, or winmail.dat file.
StoreOptions EmailStoreReaderOptions optionalposition: namedpipeline: False
Optional Apple Mail EMLX envelope, metadata, attachment, and size limits.

Outputs

OfficeIMO.Email.EmailDocument, OfficeIMO.Email.EmailReadResult, OfficeIMO.Email.Store.EmailStoreReadResult