在使用imagemagick的powershell中,如何将图像转换为新路径

在使用imagemagick的powershell中,如何将图像转换为新路径,powershell,imagemagick,imagemagick-convert,Powershell,Imagemagick,Imagemagick Convert,我想将tif转换为放置在C:\Data中的jpg\ Get-ChildItem -Path $source -filter *.tif | %{ convert $_.FullName "C:\Data\$($_.FullName -Replace ".tif+$", ".jpg")" } 但它不起作用 但是,这是可行的-它将转换后的文件放置在与原始文件相同的位置 Get-ChildItem -Path $source -filter *.tif | %{ convert $_.FullNam

我想将tif转换为放置在C:\Data中的jpg\

Get-ChildItem -Path $source -filter *.tif | %{ convert $_.FullName "C:\Data\$($_.FullName -Replace ".tif+$", ".jpg")" }
但它不起作用

但是,这是可行的-它将转换后的文件放置在与原始文件相同的位置

Get-ChildItem -Path $source -filter *.tif | %{ convert $_.FullName "$($_.FullName -Replace ".tif+$", ".jpg")" }

您将
C:\data
$\u.FullName
请尝试使用
$\uName
属性:

Get-ChildItem -Path $source -filter *.tif | %{ convert $_.FullName "C:\Data\$($_.Name -Replace ".tif+$", ".jpg")" }