Folders.csv contains the names of three folders, test001, test002 and test003. I want to move test001 and test002 from the folder \server\share\MoveFrom to the folder \server\share\MoveTo.
I can import the list but when I try to move only the folders in the list, the whole parent folder \server\share\MoveFrom gets moved into the destination \server\share\MoveTo.
I am using Powershell v2.
$Foldernames = Import-Csv "Folders.csv"
#I've also tried Get-Content "Folders.txt" without a header but I still get the same result
$Sourcepath = \\server\share\MoveFrom
$Destpath = \\server\share\MoveTo
$Foldernames | foreach { Move-Item -path $sourcepath -dest $Destpath }
Thank you for your reply…I am still seeing some wonky behavior. The parent \server\share\MoveFrom folder gets moved into the destination folder…I’m starting to think maybe the join-path isn’t working correctly. “$Source” appears to be the parent \server\share\MoveFrom folder instead of one of the subfolders that I want moved. I even tried using v4, same result. I do appreciate your input.