# Get-OfficeDocumentHierarchy

Creates bounded token-aware chunks and a deterministic document hierarchy.

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

`System.String`

**Outputs**

`OfficeIMO.Reader.ReaderChunkHierarchyResult`

**Source**

[GetOfficeDocumentHierarchyCommand.cs:17](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Reader/GetOfficeDocumentHierarchyCommand.cs#L17) 

Creates bounded token-aware chunks and a deterministic document hierarchy.

## Syntax

```
Get-OfficeDocumentHierarchy
[-ChunkingOptions <ReaderHierarchicalChunkingOptions>]
[-Path] <String>
[-Reader <OfficeDocumentReader>]
[-ReaderOptions <ReaderOptions>]
[<CommonParameters>]
```

[#](#method-get-officedocumenthierarchy-readerhierarchicalchunkingoptions-string-officedocumentreader-readeroptions)

Parameter set: `All Parameter Sets`

## Examples

### Create embedding-ready chunks with heading context.

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

Returns chunks, token evidence, overlap counts, and flattened parent/child nodes.

## Parameters

**-ChunkingOptions ReaderHierarchicalChunkingOptions optional**

Optional token budget, overlap, hierarchy, and token-counter settings.

**-Path String requiredposition: 0pipeline: True (ByValue)**

Path to read.

**-Reader OfficeDocumentReader optional**

Optional immutable OfficeIMO reader with caller-configured handlers and processors.

**-ReaderOptions ReaderOptions optional**

Optional source-reading limits and format behavior.

## 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:5BCAB0F15F9323C45D0D1EA05D0C7A503465BA6ECE9DF2790A7CA951A69D45DC -->
