I'm trying to batch-convert heic images to png images using Powershell. What I have tried:
Get-ChildItem -Include ('*.HEIC', '*.heic') -File | & .\bin\vips.exe copy $_.Name "$(_.BaseName).png"
Pause
and
Get-ChildItem -Include ('*.HEIC', '*.heic') -File | & .\bin\vips.exe copy $_.Name ($_.BaseName + '.png')
Pause
Both times I'm getting an error VipsForeignLoad: file ".png" does not exist which tells me it treats ".png" as the first (and only) argument and ignores the object Name and Basename properties.
foreachloop:Get-ChildItem -Filter "*.HEIC" -File | Foreach-Object { & .\bin\vips.exe copy $_.Name "$($_.BaseName).png" }ForEachdid it!(...)with the.ForEach()method.foreach(){}is what I meant by aForEachstatement. That one is supposedly the fastest out of the three (with the .foreach method being close 2nd).