[英]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.