In this script, everything is working as I expect for the most part. However, the rename operation will only work outside of these piped commands
Get-ChildItem -Path $folderpath -Filter $folderfile | Move-Item -
Destination $destination | sleep 5 | Out-File -FilePath $logpath -Append
If I try to do the rename as part of the piped commands, it simply doesn't work. Anywhere outside of that and it will work for a single iteratrion of the filewatcher, and then no more. Why will the rename not work as a piped command?
Get-ChildItem -Path $folderpath -Filter $folderfile | Move-Item -Destination $destination | Rename-Item $destination$folderfile -NewName $newname | Out-File -FilePath $logpath -Append