I need to moves all the files from a folder to another but not the sub-folders or anything inside it. I have no idea of the name or the extension of the files I'll need to move (and some of them will not have any) so I can't use -Include. Here is an exemple of the structure of my folder:
- Folder1
- File1
- File2
- Folder2
- File3
- File4
- Folder3
I want to move File1 and File2 in Folder3 without moving File3 and File4.
So far, I have something that looks like this:
$SouceFolder = "c:\Folder1\*"
$DestinationFolder = "c:\Folder3"
Move-Item -Path $SouceFolder -Destination $DestinationFolder
But it's copying the whole folder structure, with all the files.
Thanks.
Solution:
$SouceFolder = "c:\Folder1"
$DestinationFolder = "c:\Folder3"
Robocopy $SouceFolder $DestinationFolder /mov
Note: I removed the \* from the folder1.