I have a simple compare object script that I would like to add some kind of intelligent progress bar or countdown timer to. The script takes anywhere from 1-12 hours to run depending on the folder sizes. Here is the script:
$internal = Get-ChildItem -Recurse -path C:\Folder1
$external = Get-ChildItem -Recurse -path C:\Folder2
Compare-Object -ReferenceObject $internal -DifferenceObject $external | Out-File C:\compare_list.txt
I have a progress bar script that I found but I do not know how to implement it into my existing script. Here it is:
for ($i = 1; $i -le 100; $i++) {Write-Progress -Activity 'counting' -Status "
$i percent" -PercentComplete $i ; sleep -Milliseconds 20}
Any help is much appreciated.