Powershell recursively move 20,000 files at a time
<p>I'm a novice with Powershell.  I'm trying to move data to be processed elsewhere that has limitations on the number of files at a time it can handle.  My source folder has hundreds of subfolders that each in turn may also have up to 100 subfolders, totaling up to millions of small files.  File names are assumed to be unique 25-digit output from an export so checking existing file names at each move will not be necessary if excluding the check speeds up the overall process.</p>

<p>I'd like to automate moving (not copy) these with Powershell from source path to an incremental named destination folder of 20,000 files each.  The destination output folder names are not important as long as they each only have no more than 20,000 files in each destination and don't overlap existing folder names.</p>

<p>Example:</p>

<p>Source : C:\MyFiles has 100 subfolders that each also have 100 subfolders.</p>

<p><code>C:\Myfiles\Folder000\Folder000A\file1.txt</code>
<code>C:\Myfiles\Folder000\Folder000A\file2.txt</code>
<code>C:\Myfiles\Folder000\Folder000A\file3.txt</code>
<code>C:\Myfiles\Folder000\Folder000B\file1.txt</code>
<code>C:\Myfiles\Folder000\Folder000B\file1.txt</code>
<code>C:\Myfiles\Folder001\Folder000A\file1.txt</code>
<code>...etc</code></p>

<p>Destination D:\My20Kfiles</p>

<p><code>D:\My20kFiles\000001 [20,000 messages]</code>
<code>D:\My20kFiles\000002 [next 20,000 messages]</code>
<code>D:\My20kFiles\000003 [next 20,000 messages]</code>
<code>...etc</code></p>