# Get-OfficeMarkdownHeading

Gets heading metadata from a Markdown document. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice Cmdlet Reference.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Markdown.MarkdownDocument` `System.String`

**Outputs**

`OfficeIMO.Markdown.MarkdownDocument+HeadingInfo`

**Source**

[GetOfficeMarkdownHeadingCommand.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Markdown/GetOfficeMarkdownHeadingCommand.cs#L24) 

Gets heading metadata from a Markdown document.

## Syntax

```
Get-OfficeMarkdownHeading
[-Anchor <String>]
[-CaseSensitive]
[-Document <MarkdownDocument>]
[-HeadingText <String>]
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[<CommonParameters>]
```

[#](#method-get-officemarkdownheading-string-switchparameter-markdowndocument-string-int32-int32)

Parameter set: `Document`

```
Get-OfficeMarkdownHeading
[-Anchor <String>]
[-CaseSensitive]
[-HeadingText <String>]
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Options <Object[]>]
[-Path] <String>
[<CommonParameters>]
```

[#](#method-get-officemarkdownheading-string-switchparameter-string-int32-int32-object-string)

Parameter set: `Path`

```
Get-OfficeMarkdownHeading
[-Anchor <String>]
[-CaseSensitive]
[-HeadingText <String>]
-LiteralPath <String>
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Options <Object[]>]
[<CommonParameters>]
```

[#](#method-get-officemarkdownheading-string-switchparameter-string-string-int32-int32-object)

Parameter set: `LiteralPath`

```
Get-OfficeMarkdownHeading
[-Anchor <String>]
[-CaseSensitive]
[-HeadingText <String>]
[-MaxLevel <Int32>]
[-MinLevel <Int32>]
[-Options <Object[]>]
-Text <String>
[<CommonParameters>]
```

[#](#method-get-officemarkdownheading-string-switchparameter-string-int32-int32-object-string-2)

Parameter set: `Text`

## Description

Returns heading level, text, resolved anchor, and the backing heading block.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Parse and Inspect Markdown Files](/docs/markdown/parse-and-inspect/) Guide
  
  Load Markdown into a typed model, list headings, read and edit YAML or TOML front matter, extract tables and code blocks, and check diagnostics.
- [Markdown in .NET](/docs/markdown/) Guide
  
  Create, parse, edit and render Markdown files in .NET with OfficeIMO.Markdown, plus the PSWriteOffice Markdown cmdlets for scripts and jobs.
- [Read and Parse Markdown Content](/docs/pswriteoffice/markdown-read-parse/) Guide
  
  Read Markdown as a document model and extract front matter, headings, nodes, and tables without fragile regular expressions.

## Examples

### Read headings from Markdown text.

```powershell
Get-OfficeMarkdownHeading -Text "# Title`n`n## Details"
```

Parses Markdown text and returns the document headings.

### Inspect a parsed Markdown document.

```powershell
Open-OfficeMarkdown -Path .\README.md | Get-OfficeMarkdownHeading -MinLevel 2
```

Returns headings from an existing Markdown document object.

## Parameters

**-Anchor String optional**

Optional wildcard pattern matched against resolved heading anchors.

**-CaseSensitive SwitchParameter optional**

Use case-sensitive matching for text and anchor filters.

**-Document MarkdownDocument optionalpipeline: True (ByValue)sets: Document**

Caller-owned document; omission uses the enclosing Markdown document.

**-HeadingText String optional**

Optional wildcard pattern matched against heading text.

**-MaxLevel Int32 optional**

Maximum heading level to return.

**-MinLevel Int32 optional**

Minimum heading level to return.

**-Options Object[] optionalsets: Path, LiteralPath, Text**

Native reader options and optional native-property hashtable overrides.

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

Input file with FileSystem wildcard expansion.

**-LiteralPath String requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath**

Literal input file, including a FileInfo pipeline.

**-Text String requiredsets: Text**

Markdown source text.

## 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).

<!-- PowerForge markdown artifact sha256:6B9B3F7A8B9E5BD999C794CBDF81CD542E6D5ACB50EA4CB46E081E6EBAC8B8CB -->
