API Reference

Cmdlet

Invoke-OfficeExcelTemplateRow

Aliases: ExcelTemplateRow, ExcelTemplateRows
Namespace PSWriteOffice
Aliases
ExcelTemplateRow ExcelTemplateRows
Inputs
OfficeIMO.Excel.ExcelDocument System.Object
Outputs
System.Int32

Repeats an Excel template row for pipeline data and replaces markers in each inserted row.

Remarks

Repeats an Excel template row for pipeline data and replaces markers in each inserted row.

Examples

Authored help example

Fill invoice line rows from pipeline objects.

PS>


$items | Invoke-OfficeExcelTemplateRow -Path .\Invoice.xlsx -Sheet Invoice -TemplateRow 12 -CultureName en-US
        

Copies the template row once per input object, applies marker values, 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-OfficeExcelTemplateRow [-CultureName <String>] -InputObject <Object> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] -TemplateRow <Int32> [-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.
InputObject Object requiredposition: 1pipeline: True (ByValue)aliases: Data, 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 row.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
Sheet String optionalposition: namedpipeline: False
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.
TemplateRow Int32 requiredposition: namedpipeline: False
1-based row number that contains template markers to repeat.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker is not supplied by an input row.

Outputs

System.Int32

Invoke-OfficeExcelTemplateRow [-CultureName <String>] -InputObject <Object> -InputPath <String> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] -TemplateRow <Int32> [-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.
InputObject Object requiredposition: 1pipeline: True (ByValue)aliases: Data, Rows
Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker is not supplied by each input row.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
Sheet String optionalposition: namedpipeline: False
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.
TemplateRow Int32 requiredposition: namedpipeline: False
1-based row number that contains template markers to repeat.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker is not supplied by an input row.

Outputs

System.Int32

Invoke-OfficeExcelTemplateRow [-CultureName <String>] -Document <ExcelDocument> -InputObject <Object> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] -TemplateRow <Int32> [-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: True (ByValue)
Workbook to update outside the DSL context.
InputObject Object requiredposition: 1pipeline: True (ByValue)aliases: Data, 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 row.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
Sheet String optionalposition: namedpipeline: False
Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index when using a workbook object or path.
TemplateRow Int32 requiredposition: namedpipeline: False
1-based row number that contains template markers to repeat.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker is not supplied by an input row.

Outputs

System.Int32