Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Get-OfficeExcelPivotTable

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

Gets pivot tables defined in a workbook.

Remarks

Gets pivot tables defined in a workbook.

Examples

Authored help example

Read pivot table metadata from a workbook.

PS>


$pivots = Get-OfficeExcelPivotTable -Path .\report.xlsx -Sheet Summary
            $pivots |
                Select-Object -Property Name, Sheet, SourceRange, RowFields, DataFields |
                Format-List
        

Returns pivot table metadata so generated reports can prove the pivot source and layout.

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

Get-OfficeExcelPivotTable [-Name <String>] -Path <String> [-Sheet <String>] [-SheetIndex <Int32>] [<CommonParameters>]
#
Parameter set: Path

Parameters

Name String optionalposition: namedpipeline: False
Optional pivot table name filter.
Path String requiredposition: 0pipeline: Falsealiases: FilePath, InputPath
Path to the workbook.
Sheet String optionalposition: namedpipeline: False
Optional sheet name filter.
SheetIndex Int32 optionalposition: namedpipeline: False
Optional sheet index (0-based) filter.

Outputs

System.Management.Automation.PSObject

Get-OfficeExcelPivotTable -Document <ExcelDocument> [-Name <String>] [-Sheet <String>] [-SheetIndex <Int32>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to inspect.
Name String optionalposition: namedpipeline: False
Optional pivot table name filter.
Sheet String optionalposition: namedpipeline: False
Optional sheet name filter.
SheetIndex Int32 optionalposition: namedpipeline: False
Optional sheet index (0-based) filter.

Outputs

System.Management.Automation.PSObject