如何使用 Copy-Item 在 PowerShell 中複製多個檔案?
要在 PowerShell 中複製多個檔案,你需要用逗號 (,) 分隔每個檔案。
在下例中,我們將把多個檔案從原始檔夾複製到目標資料夾 D:\TempContent.
示例
Copy-Item .\PowerShellcommands.csv,.\cars.xml -Destination D:\TempContent\ -PassThru
輸出
PS D:\Temp> Copy-Item .\PowerShellcommands.csv,.\cars.xml -Destination D:\TempContent\ -PassThru Directory: D:\TempContent Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 20-01-2020 12:10 1148809 PowerShellcommands.csv -a---- 07-05-2018 23:00 301 cars.xml
廣告