# Get-OfficePackageSecurity

Inspects an Open XML or compound Office package without opening active content.

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.OfficePackageSecurityReport`

**Source**

[GetOfficePackageSecurityCommand.cs:18](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Security/GetOfficePackageSecurityCommand.cs#L18) 

Inspects an Open XML or compound Office package without opening active content.

## Syntax

```
Get-OfficePackageSecurity
[-Options <OfficePackageSecurityOptions>]
[-Path] <String>
[-ThrowOnViolation]
[-Untrusted]
[<CommonParameters>]
```

[#](#method-get-officepackagesecurity-officepackagesecurityoptions-string-switchparameter-switchparameter)

Parameter set: `All Parameter Sets`

## Examples

### Inventory active content and reject it under an untrusted-input policy.

```powershell
$report = Get-OfficePackageSecurity -Path .\Incoming\Report.xlsm -Untrusted
$report | Select-Object IsValid, MacroPartCount, EmbeddedPayloadPartCount, ExternalRelationshipCount
$report.Findings | Format-Table Severity, Rule, PartName, Message
```

Returns observations and policy violations; it does not execute package content.

## Parameters

**-Options OfficePackageSecurityOptions optional**

Custom package size, expansion, and active-content policy.

**-Path String requiredposition: 0pipeline: True (ByValue)aliases: FilePath**

Path to an Open XML or compound Office package.

**-ThrowOnViolation SwitchParameter optional**

Throw on the first policy violation instead of returning only the report.

**-Untrusted SwitchParameter optional**

Use the bounded policy that rejects macros, embedded payloads, ActiveX, and external relationships.

## 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:AB48EE73272E2604875CB6BCCCE484EF03E1096B5CD71040CFE9BD12752F5A37 -->
