# Add-OfficeWordHeader

Adds content to a section header. 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 **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: WordHeader

**Module**

`PSWriteOffice`

**Aliases**

`WordHeader`

**Inputs**

`None`

**Source**

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

Adds content to a section header.

## Syntax

```
Add-OfficeWordHeader
[[-Content] <ScriptBlock>]
[-PassThru]
[-Type <Default|First|Even>]
[<CommonParameters>]
```

[#](#method-add-officewordheader-scriptblock-switchparameter-wordheaderfootertype)

Parameter set: `All Parameter Sets`

## Description

Ensures the requested header part (default/first/even) exists and executes the DSL scriptblock within it.

## Examples

### Create a default header.

```powershell
Add-OfficeWordSection { Add-OfficeWordHeader { Add-OfficeWordParagraph -Text 'Confidential' -Style Heading3 } }
```

Creates a section header that prints “Confidential”.

## Parameters

**-Content ScriptBlock optionalposition: 0**

DSL scriptblock to execute inside the header.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-Type WordHeaderFooterType optional**

The header type to modify.

Possible values: `Default`, `First`, `Even`

## 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:109B8D2E98E642EE6D7635124FEC36AAF5912940F58DB51F78E32624372FFF6A -->
