API Reference

Cmdlet

Invoke-OfficeExcelTemplateOptionalRow

Aliases: ExcelTemplateOptionalRow, ExcelTemplateOptionalRows
Namespace PSWriteOffice
Aliases
ExcelTemplateOptionalRow ExcelTemplateOptionalRows
Inputs
None
Outputs
System.Int32

Includes or removes an optional Excel template row block.

Remarks

Includes or removes an optional Excel template row block.

Examples

Authored help example

Keep an optional discount row and bind markers in it.

PS>


Invoke-OfficeExcelTemplateOptionalRow -Path .\Invoice.xlsx -Sheet Invoice -FirstRow 10 -Value @{ Discount = '10%' }
        

Leaves the optional row block in place, replaces its 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-OfficeExcelTemplateOptionalRow [-CultureName <String>] -FirstRow <Int32> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-Remove] [-RowCount <Int32>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-ThrowOnMissing] [-Value <Hashtable>] [<CommonParameters>]
#
Parameter set: Context

Parameters

CultureName String optionalposition: namedpipeline: False
Culture name used for built-in marker format aliases such as currency and date.
FirstRow Int32 requiredposition: namedpipeline: False
1-based first row in the optional block.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker in the optional block is not supplied by -Value.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
Remove SwitchParameter optionalposition: namedpipeline: False
Removes the optional row block instead of keeping and binding it.
RowCount Int32 optionalposition: namedpipeline: False
Number of rows in the optional block.
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.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker in the optional block is not supplied by -Value.
Value Hashtable optionalposition: namedpipeline: Falsealiases: Values
Template marker values used when the optional row block is included.

Outputs

System.Int32

Invoke-OfficeExcelTemplateOptionalRow [-CultureName <String>] -FirstRow <Int32> -InputPath <String> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-Remove] [-RowCount <Int32>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-ThrowOnMissing] [-Value <Hashtable>] [<CommonParameters>]
#
Parameter set: Path

Parameters

CultureName String optionalposition: namedpipeline: False
Culture name used for built-in marker format aliases such as currency and date.
FirstRow Int32 requiredposition: namedpipeline: False
1-based first row in the optional block.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Workbook path to update.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker in the optional block is not supplied by -Value.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
Remove SwitchParameter optionalposition: namedpipeline: False
Removes the optional row block instead of keeping and binding it.
RowCount Int32 optionalposition: namedpipeline: False
Number of rows in the optional block.
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.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker in the optional block is not supplied by -Value.
Value Hashtable optionalposition: namedpipeline: Falsealiases: Values
Template marker values used when the optional row block is included.

Outputs

System.Int32

Invoke-OfficeExcelTemplateOptionalRow [-CultureName <String>] -Document <ExcelDocument> -FirstRow <Int32> [-MissingValueBehavior <Nullable`1>] [-PassThru] [-Remove] [-RowCount <Int32>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-ThrowOnMissing] [-Value <Hashtable>] [<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.
FirstRow Int32 requiredposition: namedpipeline: False
1-based first row in the optional block.
MissingValueBehavior Nullable`1 optionalposition: namedpipeline: False
Behavior used when a marker in the optional block is not supplied by -Value.
PassThru SwitchParameter optionalposition: namedpipeline: False
Returns the number of marker replacements.
Remove SwitchParameter optionalposition: namedpipeline: False
Removes the optional row block instead of keeping and binding it.
RowCount Int32 optionalposition: namedpipeline: False
Number of rows in the optional block.
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.
ThrowOnMissing SwitchParameter optionalposition: namedpipeline: False
Throws when a marker in the optional block is not supplied by -Value.
Value Hashtable optionalposition: namedpipeline: Falsealiases: Values
Template marker values used when the optional row block is included.

Outputs

System.Int32