Evotec

Project

PSWriteOffice

PSWriteOffice is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 144
Forks 12
Open issues 16
PowerShell Gallery downloads 150,904
Release v0.2.0
Language: C# Updated: 2026-04-06

API Reference

Cmdlet

Add-OfficeWordHeader

Namespace PSWriteOffice
Inputs
None
Outputs
System.Object

Adds content to a section header.

Remarks

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

Examples

Authored help example

Create a default header.

PS>


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

Creates a section header that prints “Confidential”.

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.

Syntax

Add-OfficeWordHeader [-Content <ScriptBlock>] [-Type <HeaderFooterValues>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Content ScriptBlock optionalposition: 0pipeline: False
DSL scriptblock to execute inside the header.
Type HeaderFooterValues optionalposition: namedpipeline: False
The header type to modify.

Outputs

System.Object