API Reference
Search-OfficeDocument
Searches one Reader result or every supported document below file and folder paths.
Remarks
Searches one Reader result or every supported document below file and folder paths.
Examples
Example 1: Search a mixed document folder without constructing .NET option objects.
PS>
Search-OfficeDocument -Path .\Evidence -Recurse -Query 'retention period'
Automatically reads supported Word, Excel, PowerPoint, PDF, email, PST, OST, and other registered formats.
Example 2: Remove the default document, store-item, and result ceilings.
PS>
Search-OfficeDocument -Path .\Evidence -Recurse -Query 'invoice' -NoDocumentLimit -AllStoreItems -AllResults
Unlimited modes are explicit because very large stores and document collections can consume substantial resources.
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
Search-OfficeDocument [-AllResults] -InputObject <OfficeDocumentReadResult> [-MatchCase] [-MaximumResults <Int32>] -Query <String> [-WholeWord] [<CommonParameters>]#DocumentParameters
- AllResults SwitchParameter
- Return every occurrence from each document instead of applying the default result ceiling.
- InputObject OfficeDocumentReadResult
- Normalized document returned by Get-OfficeDocument.
- MatchCase SwitchParameter
- Use case-sensitive ordinal matching.
- MaximumResults Int32
- Maximum occurrences returned per document. The default is 1,000.
- Query String
- Text to find in normalized document blocks.
- WholeWord SwitchParameter
- Return only occurrences surrounded by non-word characters.
Outputs
PSWriteOffice.Models.Reader.OfficeDocumentSearchMatch: PowerShell-friendly occurrence returned by a path-based document search.
Search-OfficeDocument [-AllResults] [-AllStoreItems] [-Extension <String[]>] [-IncludePageLocations] [-MatchCase] [-MaxDegreeOfParallelism <Nullable`1>] [-MaxDocuments <Nullable`1>] [-MaximumResults <Int32>] [-MaxStoreItems <Nullable`1>] [-NoDocumentLimit] -Path <String[]> -Query <String> [-Reader <OfficeDocumentReader>] [-Recurse] [-StopOnError] [-WholeWord] [<CommonParameters>]#PathParameters
- AllResults SwitchParameter
- Return every occurrence from each document instead of applying the default result ceiling.
- AllStoreItems SwitchParameter
- Project every matching item from each email store.
- Extension String[]
- Optional extensions to include. Registered Reader formats are used automatically when omitted.
- IncludePageLocations SwitchParameter
- Compute Word and RTF page locations when supported.
- MatchCase SwitchParameter
- Use case-sensitive ordinal matching.
- MaxDegreeOfParallelism Nullable`1
- Maximum document reads in flight.
- MaxDocuments Nullable`1
- Maximum documents accepted in one search. The default is 500.
- MaximumResults Int32
- Maximum occurrences returned per document. The default is 1,000.
- MaxStoreItems Nullable`1
- Maximum PST, OST, OLM, or EMLX items projected from each store. The default is 1,000.
- NoDocumentLimit SwitchParameter
- Remove the document-count ceiling.
- Path String[]
- File, directory, or wildcard path to search.
- Query String
- Text to find in normalized document blocks.
- Reader OfficeDocumentReader
- Advanced immutable Reader configured by a .NET host or New-OfficeDocumentReader.
- Recurse SwitchParameter
- Search subdirectories.
- StopOnError SwitchParameter
- Terminate the search when one document cannot be read. The default reports the error and continues.
- WholeWord SwitchParameter
- Return only occurrences surrounded by non-word characters.
Outputs
PSWriteOffice.Models.Reader.OfficeDocumentSearchMatch: PowerShell-friendly occurrence returned by a path-based document search.