process only if the worksheetname is '*' for all

This commit is contained in:
dfinke
2022-11-07 12:37:28 -05:00
parent a1986de292
commit ebdfd3d090

View File

@@ -235,8 +235,14 @@
# Write-Verbose "Import cell '$($Worksheet.Cells[$R, $P.Column].Address)' with property name '$($p.Value)' and value '$($Worksheet.Cells[$R, $P.Column].Value)'." # Write-Verbose "Import cell '$($Worksheet.Cells[$R, $P.Column].Address)' with property name '$($p.Value)' and value '$($Worksheet.Cells[$R, $P.Column].Value)'."
} }
} }
if ($WorksheetName -eq '*') {
$xlBook["$targetSheetname"] += [PSCustomObject]$NewRow $xlBook["$targetSheetname"] += [PSCustomObject]$NewRow
} }
else {
[PSCustomObject]$NewRow
}
}
#endregion #endregion
} }
} }
@@ -247,6 +253,8 @@
# $EndColumn = 0 # $EndColumn = 0
if ($Path) { $stream.close(); $ExcelPackage.Dispose() } if ($Path) { $stream.close(); $ExcelPackage.Dispose() }
if ($WorksheetName -eq '*') {
if ($Raw) { if ($Raw) {
foreach ($entry in $xlbook.GetEnumerator()) { foreach ($entry in $xlbook.GetEnumerator()) {
$entry.Value $entry.Value
@@ -261,4 +269,5 @@
} }
} }
} }
}
} }