I'm trying to move folders (from a list) from one folder to another. I found this powershell script on technet:
$listPath = [Populate with the path to your CSV file]
$homepath = "C:\homefolder"
$archive = "C:\temp"
$list = import-csv $listPath
foreach($user in $list)
$path = Join-Path $homepath -childpath $user.username
move-item $path $archive
But on testing, eg
$homepath = K:\Test
$archive = K:\Archive
The whole "Test" folder gets moved into the Archive folder. I just want the user's folder and contents within \Test to move into \Archive.