Hi,
Since you have moved the item to the destination path, you cannot remove it as it no longer exists in the source path. If you want to remove it later you should use copy-item instead
.
Get-ChildItem -Path $Source1 -Recurse | Copy-Item -Destination $Target1 -Force
Remove-Item -Path $Source1 -Recurse
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.