diff --git a/ImportExcel.psd1 b/ImportExcel.psd1 index 79a863f5..f22d801c 100644 --- a/ImportExcel.psd1 +++ b/ImportExcel.psd1 @@ -6,7 +6,7 @@ RootModule = 'ImportExcel.psm1' # Version number of this module. - ModuleVersion = '7.8.6' + ModuleVersion = '7.8.7' # ID used to uniquely identify this module GUID = '60dd4136-feff-401a-ba27-a84458c57ede' diff --git a/Private/ArgumentCompletion.ps1 b/Private/ArgumentCompletion.ps1 index f7ced450..ceaefe87 100644 --- a/Private/ArgumentCompletion.ps1 +++ b/Private/ArgumentCompletion.ps1 @@ -67,9 +67,8 @@ function WorksheetArgumentCompleter { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $xlPath = $fakeBoundParameter['Path'] if (Test-Path -Path $xlPath) { - $xlpkg = Open-ExcelPackage -ReadOnly -Path $xlPath - $WorksheetNames = $xlPkg.Workbook.Worksheets.Name - Close-ExcelPackage -nosave -ExcelPackage $xlpkg + $xlSheet = Get-ExcelSheetInfo -Path $xlPath + $WorksheetNames = $xlSheet.Name $WorksheetNames.where( { $_ -like "*$wordToComplete*" }) | foreach-object { New-Object -TypeName System.Management.Automation.CompletionResult -ArgumentList "'$_'", $_ , ([System.Management.Automation.CompletionResultType]::ParameterValue) , $_ diff --git a/changelog.md b/changelog.md index 07edfd1e..59428991 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +# 7.8.7 + +- Thanks to [Phil Bossman](https://github.com/pbossman) for the PR and fixing this. + + Now, back again, you can type `Import-Excel .\yearlySales.xlsx`, press and get a list of the worksheets in the Excel file + + ![alt text](images/AutoCompleteSheetNames.png) + # Infrastructure change - Thank you to [RipFence](https://github.com/RipFence) who asked how to place a chart on a different sheet from the data and then did a PR adding the example. diff --git a/images/AutoCompleteSheetNames.png b/images/AutoCompleteSheetNames.png new file mode 100644 index 00000000..59b4cbd4 Binary files /dev/null and b/images/AutoCompleteSheetNames.png differ