Hi
Tom thx for reply, that wasnt what I searched, but it was helpfull.
I searched the web and finded some way to implement progress bar, but unfortunately it dont show any progress...
Please help and tell me where I made mistake.
Script below
$disc = Get-WmiObject Win32_LogicalDisk -filter "deviceID = 'e:' "
$freespace = $disc.FreeSpace
$user = $env:username
$path = "c:\aaa"
$dest = "e:\aaa"
$counter = 0
$files = Get-ChildItem $path -recurse
$file = Get-ChildItem $path -recurse -Name
$copy = Copy-Item $path $dest -recurse -Force
$status = "Copying file {0} of {1}: {2}" -f $counter,$files.Count,$file.Name
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | out-null;
{Foreach($file in $files)
{Write-Progress -Activity "Copy Data" $status -PercentComplete ($counter / $files.count*100)}
$copy
$counter++
{[System.Windows.Forms.MessageBox]::Show("Backup wykonał się poprawnie.")}
}
Best Regards and Thanks
Keiishi