0

Here $pngImage is a PNG file object and I want to save it at $folderPath, but only new image is getting created with $pngfile name but content is not same as $pngImage.

$folderPath = $outputfolder + '\' + $capfile.FullName.Split('\')[3] + '\' +
              $capfile.FullName.Split('\')[4] + '\'+$capfile.FullName.Split('\')[6]

if (!(Test-Path $folderPath))
{
  Write-Host "Creating folder:" $folderPath
  New-Item $folderPath -Type Directory
}   

$pngImage = Get-Image -capFile $capfile -folderLoc $folderPath
$pngfile = $capfile.BaseName+".png"
New-Item -Path $folderPath -name $pngfile -ItemType "file" -Value $pngImage. -force
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
Spidy776
  • 181
  • 1
  • 2
  • 10
  • Get-Image is a custom function? Can you use solutions mentioned [already](http://stackoverflow.com/questions/6863021/convert-all-images-to-jpg) – lloyd May 05 '15 at 07:28
  • yes it is returning only png object and deleteing source folder after returing the object – Spidy776 May 05 '15 at 07:31
  • can you use solutions mentioned [already](http://stackoverflow.com/questions/6863021/convert-all-images-to-jpg) or does the file cease to exist before you go to save? – lloyd May 05 '15 at 07:47
  • How *exactly* is the content different? Also, please show the implementation of `Get-Image`. – Ansgar Wiechers May 05 '15 at 08:15

0 Answers0