Added Get-ExcelFileSummary

This commit is contained in:
dfinke
2021-02-28 15:59:42 -05:00
parent 0f354be443
commit 88638a87a9
3 changed files with 33 additions and 1 deletions

View File

@@ -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',

View File

@@ -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
}
}

View File

@@ -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.