Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Get-OfficeExcelPivotTable

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

Gets pivot tables defined in a workbook.

Syntax

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

Examples

Read pivot table metadata from a workbook.

$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.

Parameters

-Name String optional
Optional pivot table name filter.
-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Path to the workbook.
-Sheet String optional
Optional sheet name filter.
-SheetIndex Int32 optional
Optional sheet index (0-based) filter.
-Document ExcelDocument requiredpipeline: True (ByValue)sets: Document
Workbook to inspect.

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.