fix: Fix merging csv when data present

This commit is contained in:
DrIOS
2024-06-17 19:19:07 -05:00
parent aa76de6649
commit d6c500f953
5 changed files with 13 additions and 18 deletions

View File

@@ -10,7 +10,8 @@ function Update-WorksheetCell {
$firstItem = $Data[0]
$colIndex = 1
foreach ($property in $firstItem.PSObject.Properties) {
if ($StartingRowIndex -eq 2 -and $Worksheet.Cells[1, $colIndex].Value -eq $null) {
# Update headers if they don't exist or if explicitly needed
if ($Worksheet.Cells[1, $colIndex].Value -ne $property.Name) {
$Worksheet.Cells[1, $colIndex].Value = $property.Name
}
$colIndex++