API Reference
Cmdlet
Add-OfficeExcelValidationList
Adds a list-based data validation to a worksheet range.
Remarks
When invoked inside the Excel DSL, applies to the current worksheet.
Examples
Example 1: Add a validation list to a range.
PS>
ExcelSheet 'Data' { Add-OfficeExcelValidationList -Range 'C2:C50' -Values 'New','In Progress','Done' }
Restricts column C to the provided values.
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
Add-OfficeExcelValidationList [-AllowBlank <Boolean>] [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-PassThru] [-Range <String>] [-TableName <String>] -Values <String[]> [<CommonParameters>]#Parameter set:
ContextParameters
- AllowBlank Boolean
- Allow blank values.
- HeaderName String
- Header or table column name used to resolve the target range.
- HeaderRow Int32
- Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
- IncludeHeader SwitchParameter
- Include the header cell in the resolved range.
- PassThru SwitchParameter
- Emit the range string after applying validation.
- Range String
- Target range in A1 notation.
- TableName String
- Optional table name for header-based range resolution.
- Values String[]
- Allowed values for the dropdown list.
Add-OfficeExcelValidationList [-AllowBlank <Boolean>] -Document <ExcelDocument> [-HeaderName <String>] [-HeaderRow <Int32>] [-IncludeHeader] [-PassThru] [-Range <String>] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-TableName <String>] -Values <String[]> [<CommonParameters>]#Parameter set:
DocumentParameters
- AllowBlank Boolean
- Allow blank values.
- Document ExcelDocument
- Workbook to operate on outside the DSL context.
- HeaderName String
- Header or table column name used to resolve the target range.
- HeaderRow Int32
- Worksheet header row used when resolving HeaderName without a table. Use 0 for the first row of the used range.
- IncludeHeader SwitchParameter
- Include the header cell in the resolved range.
- PassThru SwitchParameter
- Emit the range string after applying validation.
- Range String
- Target range in A1 notation.
- Sheet String
- Worksheet name when using Document.
- SheetIndex Nullable`1
- Worksheet index (0-based) when using Document.
- TableName String
- Optional table name for header-based range resolution.
- Values String[]
- Allowed values for the dropdown list.