mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-10 13:23:29 +00:00
works locally, not in the CI tho
This commit is contained in:
@@ -300,16 +300,6 @@ function Import-Excel {
|
|||||||
)
|
)
|
||||||
begin {
|
begin {
|
||||||
$sw = [System.Diagnostics.Stopwatch]::StartNew()
|
$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 {
|
Function Get-PropertyNames {
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
@@ -356,6 +346,15 @@ function Import-Excel {
|
|||||||
|
|
||||||
process {
|
process {
|
||||||
if ($path) {
|
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'
|
$stream = New-Object -TypeName System.IO.FileStream -ArgumentList $Path, 'Open', 'Read', 'ReadWrite'
|
||||||
if ($Password) { $ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream , $Password }
|
if ($Password) { $ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream , $Password }
|
||||||
else { $ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream }
|
else { $ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage -ArgumentList $stream }
|
||||||
|
|||||||
Reference in New Issue
Block a user