Powershell 2 copy-item which creates a folder if doesn't exist

Posted by MicMit on Stack Overflow See other posts from Stack Overflow or by MicMit
Published on 2010-04-23T00:50:08Z Indexed on 2010/04/23 0:53 UTC
Read the original article Hit count: 347

Filed under:
|
$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.

© Stack Overflow or respective owner

Related posts about powershell-v2.0

Related posts about powershell