Merge pull request #782 from JustinGrote/patch-1

Remove Write-Debug Performance Outputs
This commit is contained in:
Doug Finke
2020-02-15 07:13:39 -05:00
committed by GitHub

View File

@@ -117,7 +117,6 @@
throw "Worksheet '$WorksheetName' not found, the workbook only contains the worksheets '$($ExcelPackage.Workbook.Worksheets)'. If you only wish to select the first worksheet, please remove the '-WorksheetName' parameter." ; return throw "Worksheet '$WorksheetName' not found, the workbook only contains the worksheets '$($ExcelPackage.Workbook.Worksheets)'. If you only wish to select the first worksheet, please remove the '-WorksheetName' parameter." ; return
} }
Write-Debug $sw.Elapsed.TotalMilliseconds
#region Get rows and columns #region Get rows and columns
#If we are doing dataonly it is quicker to work out which rows to ignore before processing the cells. #If we are doing dataonly it is quicker to work out which rows to ignore before processing the cells.
if (-not $EndRow ) { $EndRow = $Worksheet.Dimension.End.Row } if (-not $EndRow ) { $EndRow = $Worksheet.Dimension.End.Row }
@@ -154,7 +153,6 @@
throw "Duplicate column headers found on row '$StartRow' in columns '$($Duplicates.Group.Column)'. Column headers must be unique, if this is not a requirement please use the '-NoHeader' or '-HeaderName' parameter."; return throw "Duplicate column headers found on row '$StartRow' in columns '$($Duplicates.Group.Column)'. Column headers must be unique, if this is not a requirement please use the '-NoHeader' or '-HeaderName' parameter."; return
} }
#endregion #endregion
Write-Debug $sw.Elapsed.TotalMilliseconds
if (-not $Rows) { if (-not $Rows) {
Write-Warning "Worksheet '$WorksheetName' in workbook '$Path' contains no data in the rows after top row '$StartRow'" Write-Warning "Worksheet '$WorksheetName' in workbook '$Path' contains no data in the rows after top row '$StartRow'"
} }
@@ -191,7 +189,6 @@
} }
#endregion #endregion
} }
Write-Debug $sw.Elapsed.TotalMilliseconds
} }
catch { throw "Failed importing the Excel workbook '$Path' with worksheet '$Worksheetname': $_"; return } catch { throw "Failed importing the Excel workbook '$Path' with worksheet '$Worksheetname': $_"; return }
finally { finally {