Powershell: output all data to xml file with greater-than sign (>)

Started by marcosBal, November 02, 2022, 12:36:18 PM

Previous topic - Next topic

marcosBal

In Powershell, using

start-process exiftool.exe -ArgumentList "-ext WAV -X -k $directory > test.xml"
displays the results onscreen and gives me an error for the output file:

Error: File not found - test.xml
Is the problem that exiftool is not seeing the "greater than" sign, i.e. ">"? It looks like it is looking for "test.xml" instead of writing to it.

Thank you!!

marcosBal

Never really figured it out, but I used powershell's redirect functions to create it within PS. Thanks!

StarGeek

The redirection of the greater/less than symbols is a property of the shell.  I'm guessing that by including it as part of "ArgumentList" means that PS is not seeing it.

Maybe try
start-process exiftool.exe -ArgumentList "-ext WAV -X -k $directory" >test.xml

No, that doesn't do it either.  It opens up a separate shell window. text.xml was created using this, but it was an empty file, probably because all of the exiftool output went to the opened shell window.

Either way, this is a PowerShell problem, not an exiftool one.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype