Get the list of files that are getting copied in PowerShell
$source=ls c:\temp *.*
$i=1
$source| %{
[int]$percent = $i / $source.count * 100
Write-Progress -Activity "Copying ... ($percent %)" -status $_ -PercentComplete $percent -verbose
copy $_.fullName -Destination c:\test
$i++
}
If you just want to see that in console, use the -verbose
switch:
copy-item -path $from -destination $to -verbose
If you want to get a list of files or directories:
$files = copy-item -path $from -destination $to -passthru | ?{$_ -is [system.io.fileinfo]}