# Add-OfficeMarkdownHeading

Adds a Markdown heading. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

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

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: MarkdownHeading

**Module**

`PSWriteOffice`

**Aliases**

`MarkdownHeading`

**Inputs**

`OfficeIMO.Markdown.MarkdownDoc`

**Outputs**

`OfficeIMO.Markdown.MarkdownDoc`

**Source**

[AddOfficeMarkdownHeadingCommand.cs:23](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Markdown/AddOfficeMarkdownHeadingCommand.cs#L23) 

Adds a Markdown heading.

## Syntax

```
Add-OfficeMarkdownHeading
[[-Level] <Int32>]
[-PassThru]
[-Text] <String>
[<CommonParameters>]
```

[#](#method-add-officemarkdownheading-int32-switchparameter-string)

Parameter set: `Context`

```
Add-OfficeMarkdownHeading
-Document <MarkdownDoc>
[[-Level] <Int32>]
[-PassThru]
[-Text] <String>
[<CommonParameters>]
```

[#](#method-add-officemarkdownheading-markdowndoc-int32-switchparameter-string)

Parameter set: `Document`

## Examples

### Add headings that feed the Markdown table of contents.

```powershell
New-OfficeMarkdown -Path .\Report.md {
    Add-OfficeMarkdownHeading -Level 1 -Text 'Operational Report'
    Add-OfficeMarkdownTableOfContents -Title 'Contents' -MinLevel 2 -MaxLevel 3 -PlaceAtTop
    Add-OfficeMarkdownHeading -Level 2 -Text 'Overview'
    Add-OfficeMarkdownParagraph -Text 'Current operational state.'
}
```

Appends headings that can be included in a generated table of contents.

## Parameters

**-Level Int32 optionalposition: 0**

Heading level (1-6).

**-PassThru SwitchParameter optional**

Emit the Markdown document after appending the heading.

**-Text String requiredposition: 1**

Heading text.

**-Document MarkdownDoc requiredpipeline: True (ByValue)sets: Document**

Markdown document to update outside the DSL context.

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