API Reference

Cmdlet

Add-OfficeExcelSlicer

Aliases: ExcelSlicer
Namespace PSWriteOffice
Aliases
ExcelSlicer
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
System.Management.Automation.PSObject

Adds OfficeIMO-owned workbook slicer binding metadata.

Remarks

Adds OfficeIMO-owned workbook slicer binding metadata.

Examples

Authored help example

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: Context

Parameters

Name String requiredposition: namedpipeline: False
Slicer cache name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit metadata about the added package part.
PivotTableName String optionalposition: namedpipeline: False
Pivot table name the slicer is intended to filter.
SourceName String optionalposition: namedpipeline: False
Source field, table column, or pivot field name.
Xml String optionalposition: namedpipeline: False
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: Path

Parameters

InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
Name String requiredposition: namedpipeline: False
Slicer cache name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit metadata about the added package part.
PivotTableName String optionalposition: namedpipeline: False
Pivot table name the slicer is intended to filter.
SourceName String optionalposition: namedpipeline: False
Source field, table column, or pivot field name.
Xml String optionalposition: namedpipeline: False
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: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to update outside the DSL context.
Name String requiredposition: namedpipeline: False
Slicer cache name.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit metadata about the added package part.
PivotTableName String optionalposition: namedpipeline: False
Pivot table name the slicer is intended to filter.
SourceName String optionalposition: namedpipeline: False
Source field, table column, or pivot field name.
Xml String optionalposition: namedpipeline: False
Caller-supplied slicer cache XML. When provided, OfficeIMO writes it as-is.

Outputs

System.Management.Automation.PSObject