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

Namespace PSWriteOffice
Inputs
None
Outputs
System.Object

Adds or reuses a section inside the current Word document.

Remarks

Provides the DSL entry point for section-level operations inside New-OfficeWord.

Examples

Authored help example

Create a section with a paragraph.

PS>


New-OfficeWord -Path .\doc.docx { Add-OfficeWordSection { Add-OfficeWordParagraph -Text 'Hello' } }
        

Creates a document and inserts a section that contains a single paragraph.

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-OfficeWordSection [-BreakType <Nullable`1>] [-Content <ScriptBlock>] [-PassThru] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

BreakType Nullable`1 optionalposition: namedpipeline: False
Optional section break type.
Content ScriptBlock optionalposition: 0pipeline: False
DSL scriptblock executed within the section scope.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the created WordSection.

Outputs

System.Object