Cmdlet
New-OfficeExcelTestOptions
Creates Excel checks for Test-OfficeDocument: capability preflight and package validation.
Syntax
New-OfficeExcelTestOptions
[-Capability <ExcelPreflightCapability[]>]
[-IncludeFeatures]
[-IncludeRepairHints]
[-NoOpenXmlValidation]
[<CommonParameters>]#Parameter set:
DefaultExamples
Check that formulas can be calculated
Test-OfficeDocument -Path .\Finance\Budget-2027.xlsx -Options (New-OfficeExcelTestOptions -Capability CalculateFormulas)Tests whether OfficeIMO can calculate the formulas in a workbook.
Preflight templates before a report run
$checks = New-OfficeExcelTestOptions -Capability BindTemplate, ExportPdfReport -IncludeRepairHints
Get-ChildItem -Path .\Templates -Filter *.xltx |
Test-OfficeDocument -Options $checksChecks each template for template binding and PDF export and includes repair hints for anything that fails.
Parameters
- -Capability ExcelPreflightCapability[]
- Capabilities to evaluate or enforce. Defaults to all capabilities.
- Possible values:
ReadWorkbookData,EditCellValues,EditWorkbookStructure,UseCachedFormulaValues,CalculateFormulas,BindTemplate,ExportPdfReport - -IncludeFeatures SwitchParameter
- Include discovered feature rows in object output.
- -IncludeRepairHints SwitchParameter
- Include actionable OfficeIMO repair hints for blocked capabilities.
- -NoOpenXmlValidation SwitchParameter
- Skips native Open XML schema validation while retaining other workbook checks.
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.