API Reference
Cmdlet
Invoke-OfficeExcelTemplateRow
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
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:
ContextParameters
- CultureName String
- Culture name used for built-in marker format aliases such as currency and date.
- InputObject Object
- Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
- MissingValueBehavior Nullable`1
- Behavior used when a marker is not supplied by each input row.
- PassThru SwitchParameter
- Returns the number of marker replacements.
- Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- SheetIndex Nullable`1
- Worksheet index when using a workbook object or path.
- TemplateRow Int32
- 1-based row number that contains template markers to repeat.
- ThrowOnMissing SwitchParameter
- 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:
PathParameters
- CultureName String
- Culture name used for built-in marker format aliases such as currency and date.
- InputObject Object
- Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
- InputPath String
- Workbook path to update.
- MissingValueBehavior Nullable`1
- Behavior used when a marker is not supplied by each input row.
- PassThru SwitchParameter
- Returns the number of marker replacements.
- Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- SheetIndex Nullable`1
- Worksheet index when using a workbook object or path.
- TemplateRow Int32
- 1-based row number that contains template markers to repeat.
- ThrowOnMissing SwitchParameter
- 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:
DocumentParameters
- CultureName String
- Culture name used for built-in marker format aliases such as currency and date.
- Document ExcelDocument
- Workbook to update outside the DSL context.
- InputObject Object
- Pipeline data. Hashtables, dictionaries, PSCustomObjects, and typed objects are supported.
- MissingValueBehavior Nullable`1
- Behavior used when a marker is not supplied by each input row.
- PassThru SwitchParameter
- Returns the number of marker replacements.
- Sheet String
- Worksheet name. Defaults to the current sheet inside an ExcelSheet block.
- SheetIndex Nullable`1
- Worksheet index when using a workbook object or path.
- TemplateRow Int32
- 1-based row number that contains template markers to repeat.
- ThrowOnMissing SwitchParameter
- Throws when a marker is not supplied by an input row.
Outputs
System.Int32