diff --git a/ImportExcel.psd1 b/ImportExcel.psd1 index fc62949..83a98b4 100644 --- a/ImportExcel.psd1 +++ b/ImportExcel.psd1 @@ -6,7 +6,7 @@ RootModule = 'ImportExcel.psm1' # Version number of this module. - ModuleVersion = '7.1.1' + ModuleVersion = '7.1.2' # ID used to uniquely identify this module GUID = '60dd4136-feff-401a-ba27-a84458c57ede' @@ -52,6 +52,7 @@ Check out the How To Videos https://www.youtube.com/watch?v=U3Ne_yX4tYo&list=PL5 'Export-Excel', 'Export-ExcelSheet', 'Get-ExcelColumnName', + 'Get-ExcelFileSummary', 'Get-ExcelSheetInfo', 'Get-ExcelWorkbookInfo', 'Get-HtmlTable', diff --git a/Public/Get-ExcelFileSummary.ps1 b/Public/Get-ExcelFileSummary.ps1 new file mode 100644 index 0000000..6aeae2f --- /dev/null +++ b/Public/Get-ExcelFileSummary.ps1 @@ -0,0 +1,28 @@ +function Get-ExcelFileSummary { + <# + .Synopsis + Gets summary information on an Excel file like number of rows, columns, and more + #> + param( + [Parameter(ValueFromPipelineByPropertyName, Mandatory)] + [Alias('FullName')] + $Path + ) + + Process { + $excel = Open-ExcelPackage -Path $Path + + foreach ($workSheet in $excel.Workbook.Worksheets) { + [PSCustomObject][Ordered]@{ + ExcelFile = Split-Path -Leaf $Path + WorksheetName = $workSheet.Name + Rows = $workSheet.Dimension.Rows + Columns = $workSheet.Dimension.Columns + Address = $workSheet.Dimension.Address + Path = Split-Path $Path + } + } + + Close-ExcelPackage -ExcelPackage $excel -NoSave + } +} \ No newline at end of file diff --git a/README.md b/README.md index d16e401..1952cb4 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,9 @@ Fixes, Updates and new Examples | DSUM | Sums up the numbers in a field \(column\) of records in a list or database that match conditions that you specify. | [DSUM.ps1](https://github.com/dfinke/ImportExcel/blob/12fa49e3142af2178ae1c6b18d8c757af0d629ac/Examples/ExcelBuiltIns/DSUM.ps1) | | VLookup | Setups up a sheet, you enter the name of an item and the amount is looked up | [VLOOKUP.ps1](https://github.com/dfinke/ImportExcel/blob/e42f42fde92ca636af22252b753a8329f48e15f1/Examples/ExcelBuiltIns/VLOOKUP.ps1) | +## What's new 7.1.2 + +- Added `Get-ExcelFileSummary`. Gets summary information on an Excel file like number of rows, columns, and more. ## What's new 7.0.1 More infrastructure improvements.