将文件夹从结构复制到新位置

我有一个像下面900个用户的结构

用户1个人personal.pst

我需要将个人文件夹从每个用户文件夹复制到一个新的结构,如下所示

用户1(差异用户名)个人Personal.pst

我有一个用户名的CSV,到目前为止我有这样的:

$Folders = Import-Csv "C:\drv\users.csv" $Personal = Get-ChildItem -Path $Folders.OldPath | where {$_.Name -eq "Personal"} | ForEach ($Person in $Personals{ $destination = $Folder.NewPath Copy-Item -Path $Personal -Destination $destination } 

任何帮助,将不胜感激。

如果我理解你的话,试试这个:

 $Folders = Import-Csv "C:\drv\users.csv" foreach ($folder in $Folders) { $Oldpath = $folder.oldpath $newpath = $folder.newpath $Personal = Get-ChildItem -Path $Folder.OldPath | where {$_.Name -eq "Personal"} ForEach ($Person in $Personal) { $destination = $Folder.NewPath Copy-Item -Path $Person -Destination $destination } }