How do I output the files being copied in console?

Viewed 145

I'm writing a PowerShell code to copy files in a folder to another folder. I want the console to display the files that are being copied, as well as the file size if possible.

Currently, I have tried using -Verbose But the output is not very readable.

I would like the console to display the files being copied, and the file size.

1 Answers

You can use the parameter -PassThru for Copy-Item. But it will not show you the file size.

I would recommend you to use robocopy.exe for any copy jobs in powershell. It is more reilable and in your case it will show you the filesize.

Related