API Reference
Cmdlet
Get-OfficePackageSecurity
Inspects an Open XML or compound Office package without opening active content.
Remarks
Inspects an Open XML or compound Office package without opening active content.
Examples
Inventory active content and reject it under an untrusted-input policy.
PS>
$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.
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.
Syntax
Get-OfficePackageSecurity [-Options <OfficePackageSecurityOptions>] -Path <String> [-ThrowOnViolation] [-Untrusted] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- 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.
Outputs
OfficeIMO.OfficePackageSecurityReport