views:

229

answers:

1
$from = "\\something\1 XLS\2010_04_22\*"
$to =  "c:\out\1 XLS\2010_04_22\"
copy-item $from $to -Recurse 

This works if c:\out\1 XLS\2010_04_22\ does exist . Is it possible with a single command to create "c:\out\1 XLS\2010_04_22\" if it doesn't exist.

+4  A: 

Yes, add the -Force parameter.

copy-item $from $to -Recurse -Force

Shay Levy
PowerShell is so easy when one knows it :)
stej
Gotta love it :)
Shay Levy