Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close-ExcelPackage -Show broken on MacOS due to PowerShell issue #1564

Open
pccasto opened this issue Feb 13, 2024 · 1 comment
Open

Close-ExcelPackage -Show broken on MacOS due to PowerShell issue #1564

pccasto opened this issue Feb 13, 2024 · 1 comment
Assignees

Comments

@pccasto
Copy link

pccasto commented Feb 13, 2024

This is just informational for this project.

Close-ExcelPackage with -Show results in
Start-Process: An error occurred trying to start process </dir/file> with working directory '</workdir>'. Permission denied

Line 36 in Close-ExcelPackage
if ($Show) { Start-Process -FilePath $SaveAs }

Seems to run afoul of a PowerShell bug:
PowerShell/PowerShell#20990
That bug was reported against 7.4.0, but I experienced it on 7.3.3 as well.

It is possible to patch Close-Excel package to do something like this:

$SaveAsObj = gci $SaveAs
Start-Process -FilePath  $SaveAsObj.Name   -WorkingDirectory $SaveAsObj.DirectoryName

Not suggesting this as a change to the source, but if anyone else is faced with this problem, this may help.

@pccasto pccasto changed the title Close-ExcelPackage -Show broken on MacOS/Linux due to PowerShell issue Close-ExcelPackage -Show broken on MacOS due to PowerShell issue Feb 13, 2024
@dfinke
Copy link
Owner

dfinke commented Feb 15, 2024

@pccasto Thanks for issue and workaround

@dfinke dfinke self-assigned this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants