mirror of
https://github.com/dfinke/ImportExcel.git
synced 2026-01-06 18:43:25 +00:00
Refactored
This commit is contained in:
19
Examples/ReadAllSheets/Get-ExcelSheets.ps1
Normal file
19
Examples/ReadAllSheets/Get-ExcelSheets.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
# Get-ExcelSheets
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
$path
|
||||
)
|
||||
|
||||
|
||||
$hash = @{ }
|
||||
|
||||
$e = Open-ExcelPackage $path
|
||||
|
||||
foreach ($sheet in $e.workbook.worksheets) {
|
||||
$hash[$sheet.name] = Import-Excel -ExcelPackage $e -WorksheetName $sheet.name
|
||||
}
|
||||
|
||||
Close-ExcelPackage $e -NoSave
|
||||
|
||||
$hash
|
||||
Reference in New Issue
Block a user