Search-OfficeDocument
Searches one Reader result or every supported document below file and folder paths.
Syntax
Search-OfficeDocument
[-AllResults]
[-InputObject] <OfficeDocumentReadResult>
[-MatchCase]
[-MaximumResults <Int32>]
[-Query] <String>
[-WholeWord]
[<CommonParameters>]#DocumentSearch-OfficeDocument
[-AllResults]
[-AllStoreItems]
[-Extension <String[]>]
[-IncludePageLocations]
[-MatchCase]
[-MaxDegreeOfParallelism <Int32>]
[-MaxDocuments <Int32>]
[-MaximumResults <Int32>]
[-MaxStoreItems <Int32>]
[-NoDocumentLimit]
[-Path] <String[]>
[-Query] <String>
[-Recurse]
[-StopOnError]
[-WholeWord]
[<CommonParameters>]#PathExamples
Search a mixed document folder without constructing .NET option objects.
Search-OfficeDocument -Path .\Evidence -Recurse -Query 'retention period'Automatically reads supported Word, Excel, PowerPoint, PDF, email, PST, OST, and other registered formats.
Remove the default document, store-item, and result ceilings.
Search-OfficeDocument -Path .\Evidence -Recurse -Query 'invoice' -NoDocumentLimit -AllStoreItems -AllResultsUnlimited modes are explicit because very large stores and document collections can consume substantial resources.
Parameters
- -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.
- -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.
- -MaxDegreeOfParallelism Int32
- Maximum document reads in flight.
- -MaxDocuments Int32
- Maximum documents accepted in one search. The default is 500.
- -MaxStoreItems Int32
- 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.
- -Recurse SwitchParameter
- Search subdirectories.
- -StopOnError SwitchParameter
- Terminate the search when one document cannot be read. The default reports the error and continues.
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.
Outputs
PSWriteOffice.Models.Reader.OfficeDocumentSearchMatch: PowerShell-friendly occurrence returned by a path-based document search.