API Reference
Command
Add-OfficeExcelConditionalRule
Adds a conditional formatting rule to the current worksheet.
Remarks
Adds a conditional formatting rule to the current worksheet.
Examples
Highlight values greater than 100.
PS>ExcelSheet 'Data' { Add-OfficeExcelConditionalRule -Range 'C2:C100' -Operator GreaterThan -Formula1 '100' }
Applies a conditional rule to column C.
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-OfficeExcelConditionalRule -Formula1 <String> [-Formula2 <String>] -Operator <String> [-PassThru] -Range <String> [<CommonParameters>]#Parameter set:
ContextParameters
- Formula1 String
- Primary formula or value.
- Formula2 String
- Optional secondary formula or value.
- Operator String
- Conditional formatting operator.
- PassThru SwitchParameter
- Emit the range after applying the rule.
- Range String
- A1 range to apply the rule to.
Outputs
System.Object
Add-OfficeExcelConditionalRule -Document <ExcelDocument> -Formula1 <String> [-Formula2 <String>] -Operator <String> [-PassThru] -Range <String> [-Sheet <String>] [-SheetIndex <Nullable`1>] [<CommonParameters>]#Parameter set:
DocumentParameters
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- Formula1 String
- Primary formula or value.
- Formula2 String
- Optional secondary formula or value.
- Operator String
- Conditional formatting operator.
- PassThru SwitchParameter
- Emit the range after applying the rule.
- Range String
- A1 range to apply the rule to.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
Outputs
System.Object