See if this works:
Function fcopy ($SourceDir, $DestinationDir)
{
Get-ChildItem $SourceDir -Recurse -File -Include *.jpg |
Where-Object {$_.FullName -notlike "$DestinationDir*"} | # Do *NOT* venture into the directory you're moving files to!!!
ForEach-Object {
$SourceFile = $_.FullName
$DestinationFile = $DestinationDir + $_.Name
if (Test-Path $DestinationFile) {
$i = 0
while (Test-Path $DestinationFile) {
$DestinationFile = "{0}{1}{2}{3}" -f $DestinationDir, $_.Basename, $i++, $_.Extension
}
}
Copy-Item -Path $SourceFile -Destination $DestinationFile -Verbose -Force
}
}
fcopy -SourceDir "E:\" -DestinationDir "E:\Photo_Backup\"
The problem is that the Get-ChildItem is including the files your destination directory because the destination directory is a child of your source directory.