Windows Powershell and Curl FYI

Started by StarGeek, January 20, 2016, 06:24:57 PM

Previous topic - Next topic

StarGeek

I was playing around with using ExifTool and Curl, as shown in the Piping example in the docs and was having problems getting it to work.  I kept getting strange errors that appeared to have nothing to do with the programs being used.

It turns out that at some point, Microsoft, in their infinite wisdom, created a powershell alias for curl and wget which used powershell's built in Invoke-WebRequest instead.  And which is incompatible with any options used for curl and wget.

There appears to be a few ways around this.  First, you can use the command remove-item alias:curl.  This only lasts as long as the current powershell and has to be re-entered for any new powershell.  You can also use curl.exe instead of curl as the command or use the full path to the curl command.  Finally, you can use the old CMD instead of powershell.

Edit: Or maybe not.  The command works great in the old CMD or a batch file.  But powershell is not returning the output of curl to the pipe properly even though it's finally running curl.   Very annoying.

Edit 2: Nevermind last edit.  Powershell was using an old non-ssl version of curl.  After cleaning out too many copies of Curl and getting newest version, finally got it working.  Original text is still an annoying problem, though.
"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

Phil Harvey

Hi StarGeek,

Thanks for the note.  You have learned the hard way about Microsoft's well-know strategy of modifying standardized software to try to make it their own, and making life harder for everyone in the process.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).