$Path = "E:\Pictures\Scanned\"
$files = Get-ChildItem $Path*.bmp
Add-Type -AssemblyName system.drawing
$imageFormat = "System.Drawing.Imaging.ImageFormat" -as [type]
ForEach ($file in $files) {
$outputfile = $file.fullName -replace ".bmp", ".jpg"
write-host $outputfile
$image = [drawing.image]::FromFile($file.fullName)
$image.Save($outputfile, $imageFormat::jpeg)
}
If you find this script useful please donate generously.