API Reference
Cmdlet
Test-OfficeExcelTemplateBinding
Validates Excel template markers against supplied bindings before applying a template.
Remarks
Validates Excel template markers against supplied bindings before applying a template.
Examples
Fail fast when a template workbook is missing required values.
PS>
$bindings = @{
CustomerName = 'Northwind'
InvoiceDate = Get-Date
Total = 1250.75
}
$result = Test-OfficeExcelTemplateBinding -Path .\InvoiceTemplate.xlsx -Binding $bindings -AsMarkdown
$result | Set-Content .\InvoiceTemplateBinding.md
Uses OfficeIMO template inspection and returns either structured missing-marker data or the reusable Markdown marker report.
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
Test-OfficeExcelTemplateBinding [-AsMarkdown] -Binding <IDictionary> -InputPath <String> [-Quiet] [-ThrowOnMissing] [<CommonParameters>]#Parameter set:
PathParameters
- AsMarkdown SwitchParameter
- Return OfficeIMO's Markdown marker report.
- Binding IDictionary
- Template bindings keyed by marker name.
- InputPath String
- Workbook path.
- Quiet SwitchParameter
- Return only a Boolean pass/fail value.
- ThrowOnMissing SwitchParameter
- Throw when any marker is missing.
Outputs
System.Management.Automation.PSObject System.String System.Boolean
Test-OfficeExcelTemplateBinding [-AsMarkdown] -Binding <IDictionary> -Document <ExcelDocument> [-Quiet] [-ThrowOnMissing] [<CommonParameters>]#Parameter set:
DocumentParameters
- AsMarkdown SwitchParameter
- Return OfficeIMO's Markdown marker report.
- Binding IDictionary
- Template bindings keyed by marker name.
- Document ExcelDocument
- Workbook document.
- Quiet SwitchParameter
- Return only a Boolean pass/fail value.
- ThrowOnMissing SwitchParameter
- Throw when any marker is missing.
Outputs
System.Management.Automation.PSObject System.String System.Boolean