0

I have managed to write my first powershell script which helps me to keep my backup organiser and up to date. It is very simple and suites my purpose. Neverthanless I am missing Progress Bar. My backup folder is almost 10Gb and it is very hard to tell what is the status of copying.

Could You please modify my script to have a progress bar? I am not experienced enought to do it.

    $basedir = "Z:\Sales\Meyer Turku\NB-1400_1401 - ICON\MTO100 - NB-1400 - KT30 & KT31\04_Engineering\BG_Ceiling Matrix Backup\00. OLD backup"
$today   = (Get-Date).ToString('dd.MM.yyyy')
$location = New-Item -Path $basedir -Type Directory -Name $today

$sourcePath = "Z:\Sales\Meyer Turku\NB-1400_1401 - ICON\MTO100 - NB-1400 - KT30 & KT31\04_Engineering\BG_Ceiling Matrix\*"
$destPath = "Z:\Sales\Meyer Turku\NB-1400_1401 - ICON\MTO100 - NB-1400 - KT30 & KT31\04_Engineering\BG_Ceiling Matrix Backup\00. OLD backup\$today"
Move-Item -Path $sourcePath -Destination $destPath -Force

$sourcePath = "C:\Users\bartosz.gornicki\Desktop\Travel Pack"
$destPath = "Z:\Sales\Meyer Turku\NB-1400_1401 - ICON\MTO100 - NB-1400 - KT30 & KT31\04_Engineering\BG_Ceiling Matrix"
Copy-Item -Path $sourcePath\* -Destination $destPath -Recurse -Force
Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63

2 Answers2

0

According to Progress during large file copy (Copy-Item & Write-Progress?) try to replace

Copy-Item -Path $sourcePath\* -Destination $destPath -Recurse -Force

With

Import-Module BitsTransfer
Start-BitsTransfer -Source $sourcePath\* -Destination $destPath -Description "Backup" -DisplayName "Backup"
Alex R.
  • 467
  • 3
  • 14
0

I got something working natively in powershell.
Check out my answer here:
Progress during large file copy (Copy-Item & Write-Progress?)

It's just a POC, there is not much error handling on it, but it works.

Hope it helps.
Happy scripting!

FranciscoNabas
  • 505
  • 3
  • 9