MScholtes / PS2EXE

Module to compile powershell scripts to executables
Other
1.24k stars 199 forks source link

Long path prefix not working #106

Closed markendr closed 1 year ago

markendr commented 1 year ago

I have been trying to get long paths working as per ms doc. The following works as expected on pwsh cmd line, or as a PS1 script..

Get-ChildItem -LiteralPath '\\?\C:\Windows'

If compile this one-liner with Invoke-PS2EXE i get the following error..

ERROR: Illegal characters in path.

Using a process of elimination ? is the problem, which seems strange since ? should not be illegal with LiteralPath as far as I understand..

Issue #92 seems related but I am not clear if there is a workaround I can use, or if it will need a PS2EXE update.

Thanks, Mark

MScholtes commented 1 year ago

Hello @markendr,

you have to set the parameter -longpaths for PS2EXE.ps1 to enable long path interpretation.

Greetings

Markus

markendr commented 1 year ago

Hi Markus,

Thanks for the quick reply that long paths are supported -- much appreciated!

Cheers