3. File System Management Tasks - Powershell

3.5 Moving Files and Directories

to move a file or folder, use the Move-Item cmdlet.

Move a file

Move-Item -Path C:\temp\test.txt -Destination C:\Users\xle0x\test.txt

this will move the file from C:\temp\test.txt to C:\Users\xle0x\test.txt.

Move a folder

Move-Item -Path C:\temp\test -Destination C:\Users\xle0x\test -Recurse

this will move the folder from C:\temp\test to C:\Users\xle0x\test with all its contents and subfolders.