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