I am using Copy-Item command to copy the multiple files from one location to another. In that, I want to get the count of files that are copied to destination.
If the above one is not possible, can we get 'True' if at least one file is copied and 'False' if none of the files are copied. I tried this but could not able to get exact one.
Thanks, Dinesh
use -passthru to create output for commands that normally run silent.
(Copy-Item -Recurse $srcPath -Destination $destPath -passThru).count
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With