PowerShell and magick arguments
Posted: 2018-12-04T20:09:51-07:00
Version: ImageMagick 7.0.8-14 Q16 x64 2018-10-24
This might be a PowerShell question more than an IM question, but I'm having the most fun time trying to get a single magick command out of Powershell. My code:
The output from the Write-Host looks perfect:
...and if I copy and paste Write-Host's output to the command line and run it, it works perfectly. But the...
...causes the error:
It seems that Write-Host and & process my argument string differently. But unless there's an equivalent of ECHO ON, I don't even know how. I don't suppose magick has an echo what I asked you to do function?
Has anyone come across this before, and - if so - how did you solve it?
This might be a PowerShell question more than an IM question, but I'm having the most fun time trying to get a single magick command out of Powershell. My code:
Code: Select all
[string]$bigFinale = ('temp2\{0}.jpg -chop {1}%x0 -gravity east -chop {2}%x0 output\{0}.jpg' -f $gapInfo[0], $gapPC1, $gapPC2)
Write-Host magick.exe $bigFinale
& magick $bigFinale
Code: Select all
magick.exe temp2\B2E001-back.jpg -chop 2%x0 -gravity east -chop 5%x0 output\B2E001-back.jpg
Code: Select all
& magick $bigFinale
Code: Select all
Error: Invalid argument or not enough arguments
Usage: magick.exe tool [ {option} | {image} ... ] {output_image}
Usage: magick.exe [ {option} | {image} ... ] {output_image}
magick.exe [ {option} | {image} ... ] -script {filename} [ {script_args} ...]
magick.exe -help | -version | -usage | -list {option}
Has anyone come across this before, and - if so - how did you solve it?