Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Last active April 24, 2024 04:23
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcefoli/b77e7f2e8d5bfd005c55 to your computer and use it in GitHub Desktop.
Save jcefoli/b77e7f2e8d5bfd005c55 to your computer and use it in GitHub Desktop.
Powershell: Move Files & Folders In Directory Recursively to Another Directory
<#
Recursively move all files in C:\SourceDir into C:\Destination
Assumes C:\Destination exists already, or there could be problems
#>
Move-Item -Path "C:\SourceDir\*" -Destination "C:\Destination"
@fourthborngoose
Copy link

fourthborngoose commented Apr 6, 2022

This was an awesome find! Simplicity at it's finest.
Get-ChildItem 'dot-slash *.(file extension)' -Recurse | Move-Item -Destination 'dot-slash'
I just... I mean I... Thanks you. It was so simple I completely missed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment