Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

New-OfficeDocumentReaderOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Reader.ReaderOptions

Creates common read, detection, package and folder policies for document readers.

Syntax

New-OfficeDocumentReaderOptions
[-DetectionMode <ExtensionOnly|ContentWhenUnknown|PreferContent>]
[-Encoding <Encoding>]
[-FailOnInvalidTextBytes]
[-FollowSymlink]
[-MaximumDetectionContainerEntries <Int32>]
[-MaximumDetectionProbeBytes <Int32>]
[-MaximumImageAssetBytes <Int64>]
[-MaximumImageAssets <Int32>]
[-MaximumImagePlacementsPerRelationship <Int32>]
[-MaximumPartUncompressedBytes <Int64>]
[-MaximumTotalImageAssetBytes <Int64>]
[-MaximumTotalUncompressedBytes <Int64>]
[-MaximumTraversalEntries <Int32>]
[-NoDeterministicOrder]
[-Projection <Full|TextAndMetadata>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Read text without derived Markdown or assets.

Read-OfficeDocument ./Report.docx -As Text -Options (New-OfficeDocumentReaderOptions -Projection TextAndMetadata)

Reuse a configured reader for a folder crawl.

$options = New-OfficeDocumentReaderOptions -DetectionMode PreferContent -MaximumTraversalEntries 50000
$reader = New-OfficeDocumentReader -Options $options
Read-OfficeDocument ./Reports -Recurse -Reader $reader

Parameters

-DetectionMode ReaderDetectionMode optional
How extension and content evidence select the format handler.
Possible values: ExtensionOnly, ContentWhenUnknown, PreferContent
-Encoding Encoding optional
Text encoding for sources without a byte-order mark.
-FailOnInvalidTextBytes SwitchParameter optional
Reject invalid byte sequences instead of replacing them.
Follow links and junctions during folder traversal. Native format admission rules still apply.
-MaximumDetectionContainerEntries Int32 optional
Maximum archive entries inspected during format detection.
-MaximumDetectionProbeBytes Int32 optional
Maximum prefix bytes inspected during content detection.
-MaximumImageAssetBytes Int64 optional
Maximum bytes retained for one Office image asset.
-MaximumImageAssets Int32 optional
Maximum retained Office image assets; zero retains none.
-MaximumImagePlacementsPerRelationship Int32 optional
Maximum placements retained for one Office image relationship.
-MaximumPartUncompressedBytes Int64 optional
Maximum uncompressed bytes in one Office package part.
-MaximumTotalImageAssetBytes Int64 optional
Maximum combined retained Office image payload bytes.
-MaximumTotalUncompressedBytes Int64 optional
Maximum combined uncompressed bytes in an Office package.
-MaximumTraversalEntries Int32 optional
Maximum raw file-system entries inspected before filtering.
-NoDeterministicOrder SwitchParameter optional
Do not sort folder traversal results.
-Projection ReaderProjection optional
Derived representations to retain.
Possible values: Full, TextAndMetadata

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.