From 5700be068487a0423273d2b301df8460eeb9c51e Mon Sep 17 00:00:00 2001 From: dfinke Date: Thu, 4 Jul 2019 11:45:42 -0400 Subject: [PATCH] works locally, not in the CI tho --- ImportExcel.psm1 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ImportExcel.psm1 b/ImportExcel.psm1 index bee1359..d7a8c5f 100644 --- a/ImportExcel.psm1 +++ b/ImportExcel.psm1 @@ -300,16 +300,6 @@ function Import-Excel { ) begin { $sw = [System.Diagnostics.Stopwatch]::StartNew() - - # $Path = (Resolve-Path $Path).ProviderPath - $resolvedPath = (Resolve-Path $Path -ErrorAction SilentlyContinue) - if ($resolvedPath) { - $Path = $resolvedPath.ProviderPath - } - else { - throw "'$($Path)' file not found" - } - Function Get-PropertyNames { <# .SYNOPSIS @@ -356,6 +346,15 @@ function Import-Excel { process { if ($path) { + # $Path = (Resolve-Path $Path).ProviderPath + $resolvedPath = (Resolve-Path $Path -ErrorAction SilentlyContinue) + if ($resolvedPath) { + $Path = $resolvedPath.ProviderPath + } + else { + throw "'$($Path)' file not found" + } + $stream = New-Object -TypeName System.IO.FileStream -ArgumentList $Path, 'Open', 'Read', 'ReadWrite' if ($Password) { $ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream , $Password } else { $ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream }