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-OfficeReaderHierarchyOptions

Module
PSWriteOffice
Inputs
None
Outputs
OfficeIMO.Reader.ReaderHierarchicalChunkingOptions

Creates discoverable token and hierarchy settings for Get-OfficeDocumentHierarchy.

Syntax

New-OfficeReaderHierarchyOptions
[-IncludeContextInText]
[-MaxContextCharacters <Int32>]
[-MaxHierarchyDepth <Int32>]
[-MaxInputChunks <Int32>]
[-MaxOutputChunks <Int32>]
[-MaxTokens <Int32>]
[-OverlapTokens <Int32>]
[-PreferMarkdown]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Create embedding-ready chunks.

$options = New-OfficeReaderHierarchyOptions -MaxTokens 500 -OverlapTokens 50 -IncludeContextInText
Get-OfficeDocumentHierarchy -Path .\handbook.pdf -ChunkingOptions $options

Parameters

-IncludeContextInText SwitchParameter optional
Include hierarchy context in chunk text.
-MaxContextCharacters Int32 optional
Maximum heading-context characters retained.
-MaxHierarchyDepth Int32 optional
Maximum heading hierarchy depth.
-MaxInputChunks Int32 optional
Maximum source chunks accepted.
-MaxOutputChunks Int32 optional
Maximum chunks returned.
-MaxTokens Int32 optional
Maximum tokens per output chunk.
-OverlapTokens Int32 optional
Tokens repeated between adjacent chunks.
-PreferMarkdown SwitchParameter optional
Prefer Markdown text where the reader supports it.

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.