Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I output the files being copied in console?

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.

like image 417
babo Avatar asked Oct 24 '25 04:10

babo


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.

like image 165
guiwhatsthat Avatar answered Oct 25 '25 18:10

guiwhatsthat