mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-11 13:53: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'
|
RootModule = 'ImportExcel.psm1'
|
||||||
|
|
||||||
# Version number of this module.
|
# Version number of this module.
|
||||||
ModuleVersion = '7.8.6'
|
ModuleVersion = '7.8.7'
|
||||||
|
|
||||||
# ID used to uniquely identify this module
|
# ID used to uniquely identify this module
|
||||||
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
||||||
|
|||||||
@@ -67,9 +67,8 @@ function WorksheetArgumentCompleter {
|
|||||||
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
|
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
|
||||||
$xlPath = $fakeBoundParameter['Path']
|
$xlPath = $fakeBoundParameter['Path']
|
||||||
if (Test-Path -Path $xlPath) {
|
if (Test-Path -Path $xlPath) {
|
||||||
$xlpkg = Open-ExcelPackage -ReadOnly -Path $xlPath
|
$xlSheet = Get-ExcelSheetInfo -Path $xlPath
|
||||||
$WorksheetNames = $xlPkg.Workbook.Worksheets.Name
|
$WorksheetNames = $xlSheet.Name
|
||||||
Close-ExcelPackage -nosave -ExcelPackage $xlpkg
|
|
||||||
$WorksheetNames.where( { $_ -like "*$wordToComplete*" }) | foreach-object {
|
$WorksheetNames.where( { $_ -like "*$wordToComplete*" }) | foreach-object {
|
||||||
New-Object -TypeName System.Management.Automation.CompletionResult -ArgumentList "'$_'",
|
New-Object -TypeName System.Management.Automation.CompletionResult -ArgumentList "'$_'",
|
||||||
$_ , ([System.Management.Automation.CompletionResultType]::ParameterValue) , $_
|
$_ , ([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
|
# 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.
|
- 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