mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Merge pull request #1591 from pbossman/master
Resolve worksheet ArgumentCompleter Fixes:#1590
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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) , $_
|
||||
|
||||
@@ -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 <ctrl+space> and get a list of the worksheets in the Excel file
|
||||
|
||||

|
||||
|
||||
# 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.
|
||||
|
||||
BIN
images/AutoCompleteSheetNames.png
Normal file
BIN
images/AutoCompleteSheetNames.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Reference in New Issue
Block a user