changed another path to providerPath

This commit is contained in:
dfinke
2016-07-01 16:19:42 -04:00
parent c7068dc562
commit d520c12227
3 changed files with 14 additions and 13 deletions

View File

@@ -1,16 +1,16 @@
Function Get-ExcelSheetInfo {
<#
.SYNOPSIS
<#
.SYNOPSIS
Get worksheet names and their indices of an Excel workbook.
.DESCRIPTION
.DESCRIPTION
The Get-ExcelSheetInfo cmdlet gets worksheet names and their indices of an Excel workbook.
.PARAMETER Path
.PARAMETER Path
Specifies the path to the Excel file. This parameter is required.
.EXAMPLE
Get-ExcelSheetInfo .\Test.xlsx
Get-ExcelSheetInfo .\Test.xlsx
.NOTES
CHANGELOG
@@ -19,8 +19,8 @@ Function Get-ExcelSheetInfo {
.LINK
https://github.com/dfinke/ImportExcel
#>
#>
[CmdletBinding()]
param(
[Alias("FullName")]
@@ -28,13 +28,13 @@ Function Get-ExcelSheetInfo {
$Path
)
process {
$Path = (Resolve-Path $Path).Path
$Path = (Resolve-Path $Path).ProviderPath
write-debug "target excel file $Path"
$stream = New-Object -TypeName System.IO.FileStream -ArgumentList $Path,"Open","Read","ReadWrite"
$xl = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream
$workbook = $xl.Workbook
if($workbook -and $workbook.Worksheets) {
$workbook.Worksheets |
$workbook.Worksheets |
Select-Object -Property name,index,hidden,@{
Label = "Path"
Expression = {$Path}

View File

@@ -4,7 +4,7 @@
RootModule = 'ImportExcel.psm1'
# Version number of this module.
ModuleVersion = '2.2.6'
ModuleVersion = '2.2.7'
# ID used to uniquely identify this module
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'

View File

@@ -29,6 +29,7 @@ iex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/dfi
# What's new
#### 7/1/2016
* Pushed 2.2.7 fixed resolve path in Get-ExcelSheetInfo
* Fixed [Casting Error in Export-Excel](https://github.com/dfinke/ImportExcel/issues/108)
* For `Import-Excel` change Resolve-Path to return ProviderPath for use with UNC