I want Copy-Item to copy to the destination file and create any subfolders on the way, but I can't seem to get that to work.
Copy-Item $fullsrc $fulldst -Recurse -Force -Verbose
$fullsrc
and $fulldst
are full paths with filenames as the destination filename is different from the source filename. Is there a way to get Copy-Item to create the subfolders and then copy the file over?
VERBOSE: Performing the operation "Copy File" on target "Item: D:\mypath\logs\001.123.log
Destination: D:\newpath\newlogs\123.234.log".
Copy-Item : Could not find a part of the path 'D:\newpath\newlogs\123.234.log'.