# Set-OfficeConfluenceManagedSection

Safely replaces one marker-delimited section in a Confluence storage body.

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 

**Module**

`PSWriteOffice`

**Inputs**

`System.String`

**Outputs**

`OfficeIMO.Confluence.ConfluenceManagedSectionResult` `System.String`

**Source**

[SetOfficeConfluenceManagedSectionCommand.cs:15](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Confluence/SetOfficeConfluenceManagedSectionCommand.cs#L15) 

Safely replaces one marker-delimited section in a Confluence storage body.

## Syntax

```
Set-OfficeConfluenceManagedSection
[-AppendIfMissing]
-ExistingBody <String>
[-PassThruBody]
-Replacement <String>
-SectionId <String>
[<CommonParameters>]
```

[#](#method-set-officeconfluencemanagedsection-switchparameter-string-switchparameter-string-string)

Parameter set: `All Parameter Sets`

## Examples

### Replace a generated report while preserving owner-authored content.

```powershell
$result = Set-OfficeConfluenceManagedSection -ExistingBody $storage -SectionId daily-report -Replacement $html -AppendIfMissing
```

Returns before/after hashes and the updated body without contacting Confluence.

## Parameters

**-AppendIfMissing SwitchParameter optional**

Append a new marker pair when the section does not exist.

**-ExistingBody String requiredpipeline: True (ByValue)**

Existing Confluence storage body.

**-PassThruBody SwitchParameter optional**

Return only the updated body string.

**-Replacement String required**

Replacement storage-format content.

**-SectionId String required**

Stable marker identifier.

## 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:7FE14159A075A953EBD3D2C719E79F50BDC4A22535FD9AD24EED6873BEE89936 -->
