API Reference
Cmdlet
Add-OfficeExcelSlicer
Adds OfficeIMO-owned workbook slicer binding metadata.
Remarks
Adds OfficeIMO-owned workbook slicer binding metadata.
Examples
Add slicer binding metadata for a pivot field.
PS>
$slicer = Add-OfficeExcelSlicer -Path .\Report.xlsx -Name RegionSlicer -SourceName Region -PivotTableName SalesPivot -PassThru
Get-OfficeExcelDataModel -Path .\Report.xlsx |
Select-Object -ExpandProperty SlicerCacheCount
Writes portable OfficeIMO binding metadata. It does not create native Excel slicer caches or UI shapes.
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-OfficeExcelSlicer -Name <String> [-PassThru] [-PivotTableName <String>] [-SourceName <String>] [-Xml <String>] [<CommonParameters>]#Parameter set:
ContextParameters
- 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 writes it as-is.
Outputs
System.Management.Automation.PSObject
Add-OfficeExcelSlicer -InputPath <String> -Name <String> [-PassThru] [-PivotTableName <String>] [-SourceName <String>] [-Xml <String>] [<CommonParameters>]#Parameter set:
PathParameters
- InputPath String
- Workbook path to update.
- 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 writes it as-is.
Outputs
System.Management.Automation.PSObject
Add-OfficeExcelSlicer -Document <ExcelDocument> -Name <String> [-PassThru] [-PivotTableName <String>] [-SourceName <String>] [-Xml <String>] [<CommonParameters>]#Parameter set:
DocumentParameters
- Document ExcelDocument
- Workbook to update outside the DSL context.
- 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 writes it as-is.
Outputs
System.Management.Automation.PSObject