mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Compare commits
4 Commits
v7.8.6
...
Fix-Import
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebdfd3d090 | ||
|
|
a1986de292 | ||
|
|
30f2597f0d | ||
|
|
09c22654ab |
@@ -235,7 +235,13 @@
|
||||
# Write-Verbose "Import cell '$($Worksheet.Cells[$R, $P.Column].Address)' with property name '$($p.Value)' and value '$($Worksheet.Cells[$R, $P.Column].Value)'."
|
||||
}
|
||||
}
|
||||
$xlBook["$targetSheetname"] += [PSCustomObject]$NewRow
|
||||
|
||||
if ($WorksheetName -eq '*') {
|
||||
$xlBook["$targetSheetname"] += [PSCustomObject]$NewRow
|
||||
}
|
||||
else {
|
||||
[PSCustomObject]$NewRow
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -247,16 +253,19 @@
|
||||
# $EndColumn = 0
|
||||
if ($Path) { $stream.close(); $ExcelPackage.Dispose() }
|
||||
|
||||
if ($Raw) {
|
||||
foreach ($entry in $xlbook.GetEnumerator()) {
|
||||
$entry.Value
|
||||
if ($WorksheetName -eq '*') {
|
||||
|
||||
if ($Raw) {
|
||||
foreach ($entry in $xlbook.GetEnumerator()) {
|
||||
$entry.Value
|
||||
}
|
||||
}
|
||||
elseif ($Worksheet.Count -eq 1) {
|
||||
$xlBook["$targetSheetname"]
|
||||
}
|
||||
else {
|
||||
$xlBook
|
||||
}
|
||||
}
|
||||
elseif ($Worksheet.Count -eq 1) {
|
||||
$xlBook["$targetSheetname"]
|
||||
}
|
||||
else {
|
||||
$xlBook
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
__tests__/ImportExcelTests/ImportExcelTiming.tests.ps1
Normal file
12
__tests__/ImportExcelTests/ImportExcelTiming.tests.ps1
Normal file
@@ -0,0 +1,12 @@
|
||||
Import-Module $PSScriptRoot\..\..\ImportExcel.psd1 -Force
|
||||
|
||||
Describe "Tests Import-Excel Timings" -Tag Timing {
|
||||
It "Should read the 20k xlsx in -le 2100 milliseconds" {
|
||||
$timer = Measure-Command {
|
||||
$data = Import-Excel $PSScriptRoot\TimingRows20k.xlsx
|
||||
}
|
||||
|
||||
$timer.TotalMilliseconds | Should -BeLessOrEqual 2100
|
||||
$data.Count | Should -Be 19999
|
||||
}
|
||||
}
|
||||
BIN
__tests__/ImportExcelTests/TimingRows20k.xlsx
Normal file
BIN
__tests__/ImportExcelTests/TimingRows20k.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user