-
Using powershell core, I am trying to write a shell command to reproduce this, which works in the terminal:
(reformatted for clarity, but all on one line in the original.) Turned into a shell command, it becomes
And when I run this, nothing happens — at least, nothing is written to disk by pandoc. I have tried every possible combination of quotes, single and double, of running it with and without "start" at the beginning, passing the arguments through stdin ... Has anyone any working examples of pandoc running under powershell in windows? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
Ah. The absolute simplest version does work: [Edit] No, no it doesn't work (again) when the file to be converted has spaces in the name. Again, a silent failure. Nothing is written to disk. |
Beta Was this translation helpful? Give feedback.
-
OK. In the hope this will be useful to others, here is the answer I have found that works. You need to de-escape the file and folder names, and pass them as literal strings, like this:
so: Single Quotes round the whole string of parameters but within those single quotes, double quotes round the unescaped parameter values (not the keys). The command itself remains unquoted. |
Beta Was this translation helpful? Give feedback.
-
Ah!!! I am using Powershell 7.3 It never occurred to me that there might be a powershell version built into SC. There must be some difference in quoting behaviour between the two. This is going to need a little thought. I can't be the only person to have been misled. |
Beta Was this translation helpful? Give feedback.
-
data.json zipped for Taitava.zip No secrets here! and you can see a couple of experimental commands in there just to check other things are working — which they are. |
Beta Was this translation helpful? Give feedback.
OK. In the hope this will be useful to others, here is the answer I have found that works. You need to de-escape the file and folder names, and pass them as literal strings, like this:
start pandoc.exe '"{{!file_path:absolute}}" -o "{{!folder_path:absolute}}\{{!title}}.docx"'
so: Single Quotes round the whole string of parameters but within those single quotes, double quotes round the unescaped parameter values (not the keys). The command itself remains unquoted.