Move files to a categorically numbered ‘bucket’ folders

Get-ChildItem -Path D:\Plans |
  ForEach-Object {
      If ([Int]$_.BaseName -le 1980) { Move-Item $_.FullName -Destination 'D:\1900s\' }
      If ([Int]$_.BaseName -ge 2000) { Move-Item $_.FullName -Destination 'D:\2000s\' }
  }

This should get you started on the direction you want, but your question isn’t very clear.

Leave a Comment