Windows instantly closing when using pwsh exe
I'm trying to create an entry for a Powershell command, but when I try it, it instantly closes the window:
I can see the command for just a split second. In this screenshot I also tried adding Read-Host to keep the window open, but there is no difference:
^^^ This disappears after a split seconds
I also tried it with just ls:
^^^ This disappears after a split seconds
try add -noexit sample: https://github.com/ikas-mc/ContextMenuForWindows11/discussions/173
Thanks, I somehow missed the samples, looked only in Issues.
-noe -c ffprobe '{path}' is my final solution.
I also got hung up on the ", because in the sample it's \\\", which means it needs to be \" in the GUI which took me a bit to understand.
One more thing: Do you know why pwsh -c { } does not work. It only prints the command. Since this usually works in the Terminal?
The issue is that ' ' and \" \" get resolved beforehand I believe and this causes files with spaces in them to fail. { } usually prevents this.
It's probably because { } are not escaped. Are they escapable? \{ \} doesn't seem to work.
For testing I put two spaces in the file name Video .AV1.mkv. {path} gets resolved to Video .AV1.mkv however with only one space. This seems to be a separate issue.
Feel free to close this issue. The handling of double-spaces is pretty niche anyway.
This may be the logic of PowerShell itself, I'm not familiar with PowerShell, but it seems like {} can't be escaped