mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
158 lines
2.5 KiB
Markdown
158 lines
2.5 KiB
Markdown
---
|
|
external help file: ImportExcel-help.xml
|
|
Module Name: ImportExcel
|
|
online version: null
|
|
schema: 2.0.0
|
|
---
|
|
|
|
# ConvertFrom-ExcelData
|
|
|
|
## SYNOPSIS
|
|
|
|
Reads data from a sheet, and for each row, calls a custom scriptblock with a list of property names and the row of data.
|
|
|
|
## SYNTAX
|
|
|
|
```text
|
|
ConvertFrom-ExcelData [-Path] <Object> [[-ScriptBlock] <ScriptBlock>] [[-WorksheetName] <Object>]
|
|
[[-HeaderRow] <Int32>] [[-Header] <String[]>] [-NoHeader] [-DataOnly] [<CommonParameters>]
|
|
```
|
|
|
|
## DESCRIPTION
|
|
|
|
## EXAMPLES
|
|
|
|
### EXAMPLE 1
|
|
|
|
```text
|
|
ConvertFrom-ExcelData .\testSQLGen.xlsx {
|
|
```
|
|
|
|
param\($propertyNames, $record\)
|
|
|
|
```text
|
|
$reportRecord = @()
|
|
foreach ($pn in $propertyNames) {
|
|
$reportRecord += "{0}: {1}" -f $pn, $record.$pn
|
|
}
|
|
$reportRecord +=""
|
|
$reportRecord -join "\`r\`n"
|
|
```
|
|
|
|
}
|
|
|
|
First: John Last: Doe The Zip: 12345 ....
|
|
|
|
## PARAMETERS
|
|
|
|
### -Path
|
|
|
|
```yaml
|
|
Type: Object
|
|
Parameter Sets: (All)
|
|
Aliases: FullName
|
|
|
|
Required: True
|
|
Position: 1
|
|
Default value: None
|
|
Accept pipeline input: True (ByPropertyName, ByValue)
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### -ScriptBlock
|
|
|
|
```yaml
|
|
Type: ScriptBlock
|
|
Parameter Sets: (All)
|
|
Aliases:
|
|
|
|
Required: False
|
|
Position: 2
|
|
Default value: None
|
|
Accept pipeline input: False
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### -WorksheetName
|
|
|
|
```yaml
|
|
Type: Object
|
|
Parameter Sets: (All)
|
|
Aliases: Sheet
|
|
|
|
Required: False
|
|
Position: 3
|
|
Default value: 1
|
|
Accept pipeline input: False
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### -HeaderRow
|
|
|
|
```yaml
|
|
Type: Int32
|
|
Parameter Sets: (All)
|
|
Aliases:
|
|
|
|
Required: False
|
|
Position: 4
|
|
Default value: 1
|
|
Accept pipeline input: False
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### -Header
|
|
|
|
```yaml
|
|
Type: String[]
|
|
Parameter Sets: (All)
|
|
Aliases:
|
|
|
|
Required: False
|
|
Position: 5
|
|
Default value: None
|
|
Accept pipeline input: False
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### -NoHeader
|
|
|
|
```yaml
|
|
Type: SwitchParameter
|
|
Parameter Sets: (All)
|
|
Aliases:
|
|
|
|
Required: False
|
|
Position: Named
|
|
Default value: False
|
|
Accept pipeline input: False
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### -DataOnly
|
|
|
|
```yaml
|
|
Type: SwitchParameter
|
|
Parameter Sets: (All)
|
|
Aliases:
|
|
|
|
Required: False
|
|
Position: Named
|
|
Default value: False
|
|
Accept pipeline input: False
|
|
Accept wildcard characters: False
|
|
```
|
|
|
|
### CommonParameters
|
|
|
|
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
|
|
|
## INPUTS
|
|
|
|
## OUTPUTS
|
|
|
|
## NOTES
|
|
|
|
## RELATED LINKS
|
|
|