Cmdlet
Invoke-OfficeExcelTemplateSheet
Repeats an Excel template worksheet for pipeline data and applies markers in each generated sheet.
Syntax
Invoke-OfficeExcelTemplateSheet [-CultureName <String>] [-Item] <Object> [-MissingValueBehavior <PreserveMarker|EmptyString|Throw>] [-PassThru] [-SheetNameProperty <String>] [-TemplateSheet <String>] [-ThrowOnMissing] [<CommonParameters>]#Parameter set:
ContextInvoke-OfficeExcelTemplateSheet [-CultureName <String>] [-Item] <Object> [-MissingValueBehavior <PreserveMarker|EmptyString|Throw>] [-PassThru] [-Path] <String> [-SheetNameProperty <String>] [-TemplateSheet <String>] [-ThrowOnMissing] [<CommonParameters>]#Parameter set:
PathInvoke-OfficeExcelTemplateSheet [-CultureName <String>] -Document <ExcelDocument> [-Item] <Object> [-MissingValueBehavior <PreserveMarker|EmptyString|Throw>] [-PassThru] [-SheetNameProperty <String>] [-TemplateSheet <String>] [-ThrowOnMissing] [<CommonParameters>]#Parameter set:
DocumentExamples
Create one invoice worksheet per pipeline object.
$invoices | Invoke-OfficeExcelTemplateSheet -Path .\Invoices.xlsx -TemplateSheet Template -SheetNameProperty SheetNameUses the template sheet for the first object, copies it for later objects, binds markers, and saves the workbook.
Parameters
- -CultureName String
- Culture name used for built-in marker format aliases such as currency and date.
- -Item Object
- Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
- -MissingValueBehavior ExcelTemplateMissingValueBehavior
- Behavior used when a marker is not supplied by each input item.
- Possible values:
PreserveMarker,EmptyString,Throw - -PassThru SwitchParameter
- Returns the number of marker replacements.
- -SheetNameProperty String
- Input property used as the generated worksheet name.
- -TemplateSheet String
- Template worksheet name. Defaults to the current sheet inside an ExcelSheet block or the first sheet for path/document use.
- -ThrowOnMissing SwitchParameter
- Throws when a marker is not supplied by an input item.
- -Path String
- Workbook path to update.
- -Document ExcelDocument
- Workbook to update outside the DSL context.
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.