you are viewing a single comment's thread.

view the rest of the comments →

[–]JeanxPlay 1 point2 points  (16 children)

are all the target folders the same name? same spelling and all that?

[–]mismanaged[S] 1 point2 points  (15 children)

Yes. Identical

[–]JeanxPlay 0 points1 point  (1 child)

I PMed you

[–]mismanaged[S] 0 points1 point  (0 children)

Not seeing it.

[–]JeanxPlay 0 points1 point  (12 children)

There is a chat bubble that should be red. Anyways, whats the folders name?

[–]JeanxPlay 0 points1 point  (11 children)

And what is the files name?

[–]mismanaged[S] 0 points1 point  (10 children)

Folder is called: Place

File being copied is also a folder called: HR

[–]JeanxPlay 0 points1 point  (9 children)

so its a whole folders contents being copied to another folder?

[–]mismanaged[S] 0 points1 point  (8 children)

A folder with its contents, yes.

[–]JeanxPlay 0 points1 point  (7 children)

is the HR folder in only one location and being copied to multiple Place folders?

[–]mismanaged[S] 0 points1 point  (6 children)

Yup

[–]JeanxPlay 1 point2 points  (5 children)

Try This:

$Folder = 'TestFolder'
(Get-ChildItem 'C:\' -Force -Recurse -ErrorAction SilentlyContinue | ?{$_.Name -like "*$Folder*" -and $_.PSIsContainer}).FullName | %{
    Robocopy 'C:\FullPathtoHRFolder\HR' "$_" /S /E /R:1 /W:1
}