Hi, I'm trying to build a script that will only move 3 files at a time from a directory that may contain dozens of files. I'll use the Windows scheduler to run the PowerShell script every 5 minutes. So every 5 minutes 3 files will be moved.
I built the following PowerShell script that loops 3 times, but it moves all files at once. What do I need to do to only copy one file at time during each of the 3 loops? I can use either a PowerShell script or a batch file.
for($i = 0; $i -le 3; $i++)
{
get-childitem -path E:\test\TEST1\ -filter *.* | move-item -destination E:\test\TEST2
}