Cmdlet
Add-OfficeExcelReportTable
Adds a titled, styled table to the report.
Syntax
Add-OfficeExcelReportTable
[-CollectionSeparator <String>]
[-ColumnFormat <Hashtable>]
[-ExcludeProperty <String[]>]
[-FlattenOptions <OfficeObjectFlattenOptions>]
[-InputObject] <Object>
[-Name <String>]
[-NoAutoFilter]
[-NoAutoFormatDynamicCollections]
[-NoFreeze]
[-NoRowStripes]
[-PassThru]
[-Property <String[]>]
[-ShowColumnStripes]
[-ShowFirstColumn]
[-ShowLastColumn]
[-TableStyle <ExcelTableStyle>]
[[-Title] <String>]
[<CommonParameters>]#Parameter set:
DefaultExamples
Add a titled table
New-OfficeExcel -Path .\Reports\Operations.xlsx {
ExcelReportSheet 'Summary' {
ExcelReportTable (Get-Service | Where-Object Status -eq 'Stopped') 'Stopped services'
}
}Adds a styled table with a title to the report.
Choose the columns to show
$assets = Import-OfficeCsv -Path .\Data\Assets.csv
New-OfficeExcel -Path .\Reports\Asset-Review.xlsx {
ExcelReportSheet 'Assets' {
ExcelReportTitle 'Laptops due for replacement'
ExcelReportTable ($assets | Where-Object AgeYears -ge 4) 'Due this year' -Property AssetTag, User, Model, Purchased, AgeYears -Name DueLaptops -ColumnFormat @{ Purchased = 'Date'; AgeYears = '0.0' }
}
}Shows only the columns readers need from a wide asset export and leaves the internal identifiers out.
Parameters
- -CollectionSeparator String
- Text inserted between collection values flattened into one cell.
- -ColumnFormat Hashtable
- Maps column headers to number-format presets, format codes or per-column option hashtables.
- -ExcludeProperty String[]
- Exclude specific properties from exported objects.
- -FlattenOptions OfficeObjectFlattenOptions
- Nested-value projection policy; accepts a native options object or hashtable.
- -InputObject Object
- Objects, dictionaries or native tabular data supplied directly or through the pipeline.
- -Name String
- Named range name.
- -NoAutoFilter SwitchParameter
- Omits table filter buttons.
- -NoAutoFormatDynamicCollections SwitchParameter
- Disable composer auto-formatting for dynamic collection columns.
- -NoFreeze SwitchParameter
- Keeps the header row scrollable.
- -NoRowStripes SwitchParameter
- Disables alternating row bands. An explicit false value enables them.
- -PassThru SwitchParameter
- Emits the native result after the operation.
- -Property String[]
- Properties to include, in the requested column order.
- -ShowColumnStripes SwitchParameter
- Enables alternating column bands; explicit false clears them.
- -ShowFirstColumn SwitchParameter
- Emphasizes the first table column; explicit false removes the emphasis.
- -ShowLastColumn SwitchParameter
- Emphasizes the last table column; explicit false removes the emphasis.
- -TableStyle ExcelTableStyle
- Built-in table style to apply.
- Possible values:
TableStyleLight1,TableStyleLight2,TableStyleLight3,TableStyleLight4,TableStyleLight5,TableStyleLight6,TableStyleLight7,TableStyleLight8,TableStyleLight9,TableStyleLight10,TableStyleLight11,TableStyleLight12,TableStyleLight13,TableStyleLight14,TableStyleLight15,TableStyleLight16,TableStyleLight17,TableStyleLight18,TableStyleLight19,TableStyleLight20,TableStyleLight21,TableStyleMedium1,TableStyleMedium2,TableStyleMedium3,TableStyleMedium4,TableStyleMedium5,TableStyleMedium6,TableStyleMedium7,TableStyleMedium8,TableStyleMedium9,TableStyleMedium10,TableStyleMedium11,TableStyleMedium12,TableStyleMedium13,TableStyleMedium14,TableStyleMedium15,TableStyleMedium16,TableStyleMedium17,TableStyleMedium18,TableStyleMedium19,TableStyleMedium20,TableStyleMedium21,TableStyleMedium22,TableStyleMedium23,TableStyleMedium24,TableStyleMedium25,TableStyleMedium26,TableStyleMedium27,TableStyleMedium28,TableStyleDark1,TableStyleDark2,TableStyleDark3,TableStyleDark4,TableStyleDark5,TableStyleDark6,TableStyleDark7,TableStyleDark8,TableStyleDark9,TableStyleDark10,TableStyleDark11 - -Title String
- Chart title.
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.