Skip to content

Commit

Permalink
Don't request Write access to the file for Import-Excel
Browse files Browse the repository at this point in the history
This can cause locking issues, and I don't think it is really needed for this cmdlet.
  • Loading branch information
edwardmiller-mesirow committed May 17, 2024
1 parent 74cbca8 commit bf899f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Public/Import-Excel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
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'
$ExcelPackage = New-Object -TypeName OfficeOpenXml.ExcelPackage
if ($Password) { $ExcelPackage.Load($stream, $Password) }
else { $ExcelPackage.Load($stream) }
Expand Down

0 comments on commit bf899f2

Please sign in to comment.