I’m trying to copy a folder from one location to another location based on the Folder Name.
I need to move the folder for each user (the username is on the folder name) to another location. For example C:SourceFolder1_UserName to C:Destination
I was trying to use this code, but is moving everything on the source folder (not just the current user)
robocopy c:Source C:Destination *._$env:USERNAME
I need to find a code to search and copy only the Folder that contain the current username on the Folder name.
Can you guys help me on this?