# New-OfficeReaderHierarchyOptions

Creates discoverable token and hierarchy settings for Get-OfficeDocumentHierarchy.

Project

PSWriteOffice

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

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Reader.ReaderHierarchicalChunkingOptions`

**Source**

[NewOfficeReaderHierarchyOptionsCommand.cs:15](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Reader/NewOfficeReaderHierarchyOptionsCommand.cs#L15) 

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>]
```

[#](#method-new-officereaderhierarchyoptions-switchparameter-int32-int32-int32-int32-int32-int32-switchparameter)

Parameter set: `All Parameter Sets`

## Examples

### Create embedding-ready chunks.

```powershell
$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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:7B6A8ECBB8CEE42D1A19E2B4DA8061B2A22FF24AB3625547B448C39B5E7D631A -->
