This function will move folders based on a textfile with folder names.
Was created for moving user folders to an folder for archiving users when they left the company.

Syntax:
Move-UserFolders nameAndPathOfTheFileWithFolders nameOfTheFolderWhereAllUserFoldersAre archiveFolder

Example:
Move-UserFolders c:\scripts\users.txt h:\users h:\archive

 

PowerShell
Edit|Remove
function Move-UserFolders {
    param ($userFile, $userFoldersPath, $userOld)
    $users = Get-Content $userFile
    foreach ($userFolder in $users) {
        $userFullPath = $userFoldersPath + $userFolder
        Move-Item $userFullPath $userOld -ErrorAction SilentlyContinue
    }

}