In powershell using imagemagick, how to convert image to a new path -


i want convert tif jpg placed in c:\data\

get-childitem -path $source -filter *.tif | %{ convert $_.fullname "c:\data\$($_.fullname -replace ".tif+$", ".jpg")" } 

but not work.

however works - places converted file in same location original file

get-childitem -path $source -filter *.tif | %{ convert $_.fullname "$($_.fullname -replace ".tif+$", ".jpg")" } 

you're messing destination path concatting c:\data $_.fullname try $_.name property:

get-childitem -path $source -filter *.tif | %{ convert $_.fullname "c:\data\$($_.name -replace ".tif+$", ".jpg")" } 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -