# Get-OfficeDocumentDetection

Detects a document kind from extension and bounded content evidence.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`System.String`

**Outputs**

`OfficeIMO.Reader.ReaderDetectionResult`

**Source**

[GetOfficeDocumentDetectionCommand.cs:16](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Reader/GetOfficeDocumentDetectionCommand.cs#L16) 

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>]
```

[#](#method-get-officedocumentdetection-int32-int32-readerdetectionmode-switchparameter-string-officedocumentreader)

Parameter set: `All Parameter Sets`

## Examples

### Inspect the real content type of a document.

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:496C3BFECF1C1631BBCA21F298A987E062EB9B481423970667064C61DC9FF6E6 -->
