[英]Powershell: Copy all Subdirectory and Contents in Parent Folder to Another Folder Destination
我有一些名为的文件夹
C:\Source
C:\Destination
C:\Source contains
---> FolderA (having few files)
---> FolderB (having few files)
... etc
我想将所有子目录复制到C:\\ Destination
我如何编写Powershell程序,它将所有多个变量子文件夹和副本带入目录?
这不起作用,因为它导致将所有源文件夹复制到目标中
C:\Destination\Source
想保留相同的子目录文件夹结构
这似乎有效
Get-ChildItem -Path "C:\Source" |
Copy-Item -Force -Destination "C:\Destination" -Recurse -Container
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.