Cmdlet
Read-OfficeDocument
Reads supported documents once and projects text, structure or ingestion views.
Syntax
Read-OfficeDocument
[[-As] <OfficeReadView>]
[-Bundle]
[-ByPage]
[-ChunkRows <Int32>]
[-Extension <String[]>]
[-HierarchyOptions <ReaderHierarchicalChunkingOptions>]
[-IncludePageLocations]
[-Indented]
[-MaximumChunkCharacters <Int32>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumStoreItems <Int32>]
[-MaximumTableRows <Int32>]
[-MaximumTotalBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoChunks]
[-NoFootnotes]
[-NoHashes]
[-NoHeaderRow]
[-NoHeadingChunks]
[-NoNotes]
[-NoPageMarkers]
[-Ocr]
[-OcrOptions <OfficeOcrOptions>]
[-Options <Object[]>]
[-Password <SecureString>]
[-Path] <String[]>
[-Range <String>]
[-Reader <OfficeDocumentReader>]
[-Recurse]
[-Sheet <OfficeSheetSelector>]
[-StructureOptions <OfficeDocumentStructuredExtractionOptions>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]#Parameter set:
PathRead-OfficeDocument
[[-As] <OfficeReadView>]
[-Bundle]
[-ByPage]
[-HierarchyOptions <ReaderHierarchicalChunkingOptions>]
[-Indented]
[-InputObject] <OfficeDocumentReadResult>
[-NoChunks]
[-NoPageMarkers]
[-StructureOptions <OfficeDocumentStructuredExtractionOptions>]
[<CommonParameters>]#Parameter set:
InputObjectRead-OfficeDocument
[[-As] <OfficeReadView>]
[-Bundle]
[-ByPage]
[-ChunkRows <Int32>]
[-Extension <String[]>]
[-HierarchyOptions <ReaderHierarchicalChunkingOptions>]
[-IncludePageLocations]
[-Indented]
-LiteralPath <String[]>
[-MaximumChunkCharacters <Int32>]
[-MaximumFiles <Int32>]
[-MaximumInputBytes <Int64>]
[-MaximumStoreItems <Int32>]
[-MaximumTableRows <Int32>]
[-MaximumTotalBytes <Int64>]
[-MaximumXmlCharactersInPart <Int64>]
[-NoChunks]
[-NoFootnotes]
[-NoHashes]
[-NoHeaderRow]
[-NoHeadingChunks]
[-NoNotes]
[-NoPageMarkers]
[-Ocr]
[-OcrOptions <OfficeOcrOptions>]
[-Options <Object[]>]
[-Password <SecureString>]
[-Range <String>]
[-Reader <OfficeDocumentReader>]
[-Recurse]
[-Sheet <OfficeSheetSelector>]
[-StructureOptions <OfficeDocumentStructuredExtractionOptions>]
[-ThrottleLimit <Int32>]
[<CommonParameters>]#Parameter set:
LiteralPathExamples
Read a folder as text.
Read-OfficeDocument ./Reports -Recurse -As TextReuse a read result without opening its source again.
$document = Read-OfficeDocument ./Report.docx
$document | Read-OfficeDocument -As TablesParameters
- -As OfficeReadView
- Representation to return. Document is the default.
- Possible values:
Document,Text,Markdown,Json,Chunks,Hierarchy,Structure,Tables,Visuals,Assets,Ingest,Ocr - -Bundle SwitchParameter
- Return in-memory table or visual export bundles.
- -ByPage SwitchParameter
- Return one text or Markdown object for each observed page, slide or worksheet.
- -ChunkRows Int32
- Spreadsheet source rows per chunk.
- -Extension String[]
- Selected source extensions, with or without a leading dot.
- -HierarchyOptions ReaderHierarchicalChunkingOptions
- Hierarchical chunking policy.
- -IncludePageLocations SwitchParameter
- Compute page locations where the native format does not store them.
- -Indented SwitchParameter
- Indent JSON output.
- -MaximumChunkCharacters Int32
- Maximum characters per source chunk.
- -MaximumFiles Int32
- Maximum selected files; zero means no limit.
- -MaximumInputBytes Int64
- Maximum bytes per source. Native owner limits still apply.
- -MaximumStoreItems Int32
- Maximum items per mail store; zero means all.
- -MaximumTableRows Int32
- Maximum rows per table chunk.
- -MaximumTotalBytes Int64
- Maximum combined source bytes accepted in this read batch.
- -MaximumXmlCharactersInPart Int64
- Maximum XML characters in one Office package part.
- -NoChunks SwitchParameter
- Omit chunks from an ingestion summary.
- -NoFootnotes SwitchParameter
- Exclude Word footnotes.
- -NoHashes SwitchParameter
- Do not compute source and chunk hashes.
- -NoHeaderRow SwitchParameter
- Treat the first spreadsheet row as data.
- -NoHeadingChunks SwitchParameter
- Do not split Markdown at headings.
- -NoNotes SwitchParameter
- Exclude PowerPoint speaker notes.
- -NoPageMarkers SwitchParameter
- Omit portable page markers from Markdown.
- -Ocr SwitchParameter
- Recognize text in source images and scanned pages using an optional OCR engine.
- -OcrOptions OfficeOcrOptions
- Optional OCR provider and native recognition policies. Implies Ocr.
- -Options Object[]
- Typed common and format read options, or common/format-keyed hashtables.
- -Password SecureString
- Open password for encrypted sources.
- -Path String[]
- Gets or sets input paths with provider wildcard expansion.
- -Range String
- A1 range within each selected worksheet.
- -Reader OfficeDocumentReader
- Caller-configured immutable Reader.
- -Recurse SwitchParameter
- Include subfolders.
- -Sheet OfficeSheetSelector
- Spreadsheet worksheet name, one-based position or sheet object.
- -StructureOptions OfficeDocumentStructuredExtractionOptions
- Structured extraction policy.
- -ThrottleLimit Int32
- Gets or sets the maximum number of concurrent background operations.
- -InputObject OfficeDocumentReadResult
- Already read document; its source is never reopened.
- -LiteralPath String[]
- Gets or sets input paths without wildcard expansion, binding 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.