API Reference
Cmdlet
Add-OfficeExcelReportLegend
Adds a legend table to the current Excel report sheet.
Remarks
Adds a legend table to the current Excel report sheet.
Examples
Add a status legend with colored first-column values.
PS>
$legendRows = @(
[pscustomobject]@{ Status = 'Ready'; Meaning = 'Validated and ready' }
[pscustomobject]@{ Status = 'Review'; Meaning = 'Needs owner review' }
)
New-OfficeExcel -Path .\Operations.xlsx {
Add-OfficeExcelReportSheet -Name Summary {
Add-OfficeExcelReportLegend -Title 'Status legend' -Header Status, Meaning -InputObject $legendRows -FirstColumnFillByValue @{ Ready = '#d9f7be'; Review = '#fff7e6' }
}
}
Renders legend rows and applies optional fill colors keyed by the first column.
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-OfficeExcelReportLegend [-CaseSensitive] [-FirstColumnFillByValue <Hashtable>] -Header <String[]> [-HeaderFillColor <String>] -InputObject <Object[]> [-Title <String>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- CaseSensitive SwitchParameter
- Use case-sensitive matching for first-column fill values.
- FirstColumnFillByValue Hashtable
- Optional first-column fill colors keyed by first-column value.
- Header String[]
- Column headers.
- HeaderFillColor String
- Optional header fill color.
- InputObject Object[]
- Rows. Each row may be an array, enumerable, hashtable, or object.
- Title String
- Optional legend title.
Outputs
System.Object