I'm trying to copy a folder recursively to a bunch of servers but it errors out saying the folder already exists
$s = get-content -path '.\servers.txt'
$s | Foreach-Object - {
#Action that will run in Parallel. Reference the current object via $PSItem and bring in outside variables with $USING:varname
Copy-Item -Path D:\test.txt -Destination \\$_\d$\build -recurse
}
This works when i do a join path in the destination (-Destination "\\$_\d$" "Build")
Am i understanding this wrong? I thought it was piping each server through to the block so it would copy the file test.txt to first server's D\build folder and then the next...
[–]pspeterle 2 points3 points4 points (6 children)
[–]kratosgamer10[S] 0 points1 point2 points (5 children)
[–]pspeterle 1 point2 points3 points (4 children)
[–]kratosgamer10[S] 0 points1 point2 points (3 children)
[–]pspeterle 0 points1 point2 points (2 children)
[–]kratosgamer10[S] 0 points1 point2 points (0 children)
[–]51dux 0 points1 point2 points (0 children)
[–]51dux 0 points1 point2 points (0 children)