Cmdlet
Get-OfficeExcelComment
Gets notes and threaded comments that match a filter.
Syntax
Get-OfficeExcelComment
[-Author <String>]
[-Document <ExcelDocument>]
[-Kind <All| Note| Threaded>]
[-Range <String>]
[-Sheet <OfficeSheetSelector[]>]
[-TextContains <String>]
[<CommonParameters>]#Parameter set:
DocumentGet-OfficeExcelComment
[-Author <String>]
[-Kind <All| Note| Threaded>]
[-Path] <String[]>
[-Range <String>]
[-Sheet <OfficeSheetSelector[]>]
[-TextContains <String>]
[<CommonParameters>]#Parameter set:
PathGet-OfficeExcelComment
[-Author <String>]
[-Kind <All| Note| Threaded>]
-LiteralPath <String[]>
[-Range <String>]
[-Sheet <OfficeSheetSelector[]>]
[-TextContains <String>]
[<CommonParameters>]#Parameter set:
LiteralPathExamples
List all comments
Get-OfficeExcelComment -Path .\Finance\Forecast-2027.xlsxShows every note and threaded comment in the workbook.
Collect open review threads
Get-OfficeExcelComment -Path .\Finance\Forecast-2027.xlsx -Kind Threaded -Author 'Anna Kowalska' |
Export-OfficeExcel -Path .\Reviews\Forecast-Comments.xlsx -Title 'Open review comments'Finds the threaded comments left by the finance reviewer and exports them as a review list.
Parameters
- Comment author to match, ignoring case.
- -Document ExcelDocument
- Caller-owned workbook; omission uses the enclosing Excel content block.
- -Kind ExcelCommentKind
- Metadata kind to add.
- Possible values:
All,Note,Threaded - -Range String
- A1 cell range on the selected worksheet.
- -Sheet OfficeSheetSelector[]
- Worksheet name, one-based position or native worksheet object. Multi-sheet commands also accept wildcard names.
- -TextContains String
- Text fragment to match, ignoring case.
- -Path String[]
- Workbook paths resolved with filesystem wildcard support.
- -LiteralPath String[]
- Literal workbook paths, including FileInfo.FullName and provider PSPath.
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.