API Reference

Cmdlet

Invoke-OfficeExcelTemplateSheet

Aliases: ExcelTemplateSheet, ExcelTemplateSheets
Namespace PSWriteOffice
Aliases
ExcelTemplateSheet ExcelTemplateSheets
Inputs
System.Object
Outputs
System.Int32

Repeats an Excel template worksheet for pipeline data and applies markers in each generated sheet.

Remarks

Repeats an Excel template worksheet for pipeline data and applies markers in each generated sheet.

Examples

Authored help example

Create one invoice worksheet per pipeline object.

PS>


$invoices | Invoke-OfficeExcelTemplateSheet -Path .\Invoices.xlsx -TemplateSheet Template -SheetNameProperty SheetName
        

Uses the template sheet for the first object, copies it for later objects, binds markers, and saves the workbook.

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

Invoke-OfficeExcelTemplateSheet [-CultureName <String>] -Item <Object> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-SheetNameProperty <String>] [-TemplateSheet <String>] [-ThrowOnMissing] [<CommonParameters>]
#
Parameter set: Context

Parameters

CultureName String optionalposition: namedpipeline: False
Culture name used for built-in marker format aliases such as currency and date.
Item Object requiredposition: 1pipeline: True (ByValue)aliases: Data, InputObject, Rows
Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker is not supplied by each input item.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
SheetNameProperty String optionalposition: namedpipeline: Falsealiases: NameProperty
Input property used as the generated worksheet name.
TemplateSheet String optionalposition: namedpipeline: Falsealiases: Sheet, WorksheetName
Template worksheet name. Defaults to the current sheet inside an ExcelSheet block or the first sheet for path/document use.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker is not supplied by an input item.

Outputs

System.Int32

Invoke-OfficeExcelTemplateSheet [-CultureName <String>] -InputPath <String> -Item <Object> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-SheetNameProperty <String>] [-TemplateSheet <String>] [-ThrowOnMissing] [<CommonParameters>]
#
Parameter set: Path

Parameters

CultureName String optionalposition: namedpipeline: False
Culture name used for built-in marker format aliases such as currency and date.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
Item Object requiredposition: 1pipeline: True (ByValue)aliases: Data, InputObject, Rows
Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker is not supplied by each input item.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
SheetNameProperty String optionalposition: namedpipeline: Falsealiases: NameProperty
Input property used as the generated worksheet name.
TemplateSheet String optionalposition: namedpipeline: Falsealiases: Sheet, WorksheetName
Template worksheet name. Defaults to the current sheet inside an ExcelSheet block or the first sheet for path/document use.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker is not supplied by an input item.

Outputs

System.Int32

Invoke-OfficeExcelTemplateSheet [-CultureName <String>] -Document <ExcelDocument> -Item <Object> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-SheetNameProperty <String>] [-TemplateSheet <String>] [-ThrowOnMissing] [<CommonParameters>]
#
Parameter set: Document

Parameters

CultureName String optionalposition: namedpipeline: False
Culture name used for built-in marker format aliases such as currency and date.
Document ExcelDocument requiredposition: namedpipeline: False
Workbook to update outside the DSL context.
Item Object requiredposition: 1pipeline: True (ByValue)aliases: Data, InputObject, Rows
Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker is not supplied by each input item.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
SheetNameProperty String optionalposition: namedpipeline: Falsealiases: NameProperty
Input property used as the generated worksheet name.
TemplateSheet String optionalposition: namedpipeline: Falsealiases: Sheet, WorksheetName
Template worksheet name. Defaults to the current sheet inside an ExcelSheet block or the first sheet for path/document use.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker is not supplied by an input item.

Outputs

System.Int32