Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Copy or Move-item help

$
0
0

i am new to Powershell and I'm trying to copy files from one server to another. i was able to get the copy-item to work but now i need to be able to swap out the copy-item with move-item and have it recreate the folders or after the copy is done have it remove the items after they are copied. here is what i have so far.

get-childitem -path "\\server\folder\folder1\" -force |

where-object {($_. lastwritetime.dat -lt(get-date).adddays(-1))} |

copy-item -destination "\\server2\d$\test\" -recurse

that command will copy everything the way i need it and create the folders the way they are setup. 


Viewing all articles
Browse latest Browse all 6937

Trending Articles