Cmdlet
Get-OfficePackageSecurity
Inspects an Open XML or compound Office package without opening active content.
Syntax
Get-OfficePackageSecurity
[-Options <OfficePackageSecurityOptions>]
[-Path] <String>
[-ThrowOnViolation]
[-Untrusted]
[<CommonParameters>]#Parameter set:
All Parameter SetsExamples
Inventory active content and reject it under an untrusted-input policy.
$report = Get-OfficePackageSecurity -Path .\Incoming\Report.xlsm -Untrusted
$report | Select-Object IsValid, MacroPartCount, EmbeddedPayloadPartCount, ExternalRelationshipCount
$report.Findings | Format-Table Severity, Rule, PartName, MessageReturns observations and policy violations; it does not execute package content.
Parameters
- -Options OfficePackageSecurityOptions
- Custom package size, expansion, and active-content policy.
- -Path String
- Path to an Open XML or compound Office package.
- -ThrowOnViolation SwitchParameter
- Throw on the first policy violation instead of returning only the report.
- -Untrusted SwitchParameter
- 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.