Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Get-OfficeExcelConditionalFormatting

Aliases: ExcelConditionalFormatting
Module
PSWriteOffice
Aliases
ExcelConditionalFormatting
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Gets conditional formatting rules from one or more Excel worksheets.

Syntax

Get-OfficeExcelConditionalFormatting
[-HeaderName <String>]
[-HeaderRow <Int32>]
[-IncludeHeader]
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName <String>]
[<CommonParameters>]
#
Parameter set: Context
Get-OfficeExcelConditionalFormatting
[-HeaderName <String>]
[-HeaderRow <Int32>]
[-IncludeHeader]
[-Path] <String>
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName <String>]
[<CommonParameters>]
#
Parameter set: Path
Get-OfficeExcelConditionalFormatting
-Document <ExcelDocument>
[-HeaderName <String>]
[-HeaderRow <Int32>]
[-IncludeHeader]
[-Range <String>]
[-Sheet <String>]
[-SheetIndex <Int32>]
[-TableName <String>]
[<CommonParameters>]
#
Parameter set: Document

Examples

List conditional formatting rules from a workbook.

Get-OfficeExcelConditionalFormatting -Path .\Report.xlsx -Sheet Data |
                Select-Object -Property SheetName, Range, Type, Operator, Formulas

Returns rule metadata that can be filtered, exported, or used before clearing stale rules.

Parameters

-HeaderName String optionalaliases: ColumnName
Header or table column name used to resolve the range filter.
-HeaderRow Int32 optional
Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
-IncludeHeader SwitchParameter optional
Include the header cell in the resolved range.
-Range String optional
Optional A1 range filter.
-Sheet String optional
Worksheet name to inspect. Defaults to the current DSL sheet or all workbook sheets.
-SheetIndex Int32 optional
Worksheet index (0-based) to inspect. Defaults to the current DSL sheet or all workbook sheets.
-TableName String optional
Optional table name for header-based range resolution.
-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Workbook path to inspect.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Workbook to inspect outside the DSL context.

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.