Cmdlet
Add-OfficeExcelSlicer
Adds OfficeIMO-owned workbook slicer binding metadata.
Syntax
Add-OfficeExcelSlicer
-Name <String>
[-PassThru]
[-PivotTableName <String>]
[-SourceName <String>]
[-Xml <String>]
[<CommonParameters>]#Parameter set:
ContextAdd-OfficeExcelSlicer
-Name <String>
[-PassThru]
[-Path] <String>
[-PivotTableName <String>]
[-SourceName <String>]
[-Xml <String>]
[<CommonParameters>]#Parameter set:
PathAdd-OfficeExcelSlicer
-Document <ExcelDocument>
-Name <String>
[-PassThru]
[-PivotTableName <String>]
[-SourceName <String>]
[-Xml <String>]
[<CommonParameters>]#Parameter set:
DocumentExamples
Add slicer binding metadata for a pivot field.
$slicer = Add-OfficeExcelSlicer -Path .\Report.xlsx -Name RegionSlicer -SourceName Region -PivotTableName SalesPivot -PassThru
Get-OfficeExcelDataModel -Path .\Report.xlsx |
Select-Object -ExpandProperty SlicerCacheCountWrites portable OfficeIMO binding metadata. It does not create native Excel slicer caches or UI shapes.
Parameters
- -Name String
- Slicer cache name.
- -PassThru SwitchParameter
- Emit metadata about the added package part.
- -PivotTableName String
- Pivot table name the slicer is intended to filter.
- -SourceName String
- Source field, table column, or pivot field name.
- -Xml String
- Caller-supplied slicer cache XML. When provided, OfficeIMO preserves it within its pivot-interaction metadata envelope.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- Workbook to update 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.