Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeExcelReportHeading

Aliases: ExcelReportHeading
Module
PSWriteOffice
Aliases
ExcelReportHeading
Inputs
None

Adds a section heading to the report.

Syntax

Add-OfficeExcelReportHeading
[-PassThru]
[-Text] <String>
[<CommonParameters>]
#
Parameter set: Default

Examples

Add a section heading

New-OfficeExcel -Path .\Reports\Operations.xlsx {
    ExcelReportSheet 'Summary' {
        ExcelReportHeading 'Incidents'
    }
}

Starts a new section of the report.

Split a report into sections

New-OfficeExcel -Path .\Reports\Security-Review.xlsx {
    ExcelReportSheet 'Review' {
        ExcelReportTitle 'Security review' 'Q3 2026'
        ExcelReportHeading 'Privileged accounts'
        ExcelReportTable (Import-OfficeCsv -Path .\Data\Privileged-Accounts.csv)
        ExcelReportHeading 'Firewall changes'
        ExcelReportTable (Import-OfficeCsv -Path .\Data\Firewall-Changes.csv)
    }
}

Gives each part of a security report its own heading and table.

Parameters

-PassThru SwitchParameter optional
Emits the native result after the operation.
-Text String requiredposition: 0
Comment text.

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.