How to copy multiple files in PowerShell using Copy-Item?

To copy the multiple files in PowerShell, you need to separate each file with the comma (,).

In the below example, we will copy multiple files from the source to the destination folder 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