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-OfficeDocumentDetection

Module
PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Reader.ReaderDetectionResult

Detects a document kind from extension and bounded content evidence.

Syntax

Get-OfficeDocumentDetection
[-MaxContainerEntries <Int32>]
[-MaxProbeBytes <Int32>]
[-Mode <ExtensionOnly|ContentWhenUnknown|PreferContent>]
[-NoContainerInspection]
[-Path] <String>
[-Reader <OfficeDocumentReader>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Inspect the real content type of a document.

Get-OfficeDocumentDetection -Path .\upload.bin -Mode PreferContent

Returns the selected kind, confidence, media type, and evidence used by OfficeIMO.Reader.

Parameters

-MaxContainerEntries Int32 optional
Maximum archive entries inspected while classifying container formats.
-MaxProbeBytes Int32 optional
Maximum prefix bytes inspected for signatures and text markers.
-Mode ReaderDetectionMode optional
Policy used to combine extension and content evidence.
Possible values: ExtensionOnly, ContentWhenUnknown, PreferContent
-NoContainerInspection SwitchParameter optional
Skip structural inspection of ZIP-based containers.
-Path String requiredposition: 0pipeline: True (ByValue)
Path to inspect.
-Reader OfficeDocumentReader optional
Optional immutable OfficeIMO reader with caller-configured handlers and processors.

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.