title: Keep first layer of folders from Get-ChildItem when moving
body: <p>I am working on some PowerShell script that automatically moves folders and files from the 'X-Drive' folder and move it into the 'Old' folder which also is inside the 'X-Drive' folder, but I want it to keep the first layer folders only, all what's inside can be moved but only the folder needs to be kept, but it also needs to be in the 'Old' folder.</p>
  
  <pre><code>$exclude = @('Keep 1', 'Keep 2')
  Get-ChildItem -Path "C:\X-Drive" -Recurse -Exclude $exclude |
      Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-0) } |
      Move-Item -Destination "C:\X-Drive\Old" -ErrorAction 'SilentlyContinue'
  </code></pre>