I'm actually writing a powershell script that sort pictures and videos by dates. The script works fine but i would like to add a progress bar, and i don't know where to start, this might be a bit tricky for me, that's why i'm looking for help.
Here is the function that sort pictures
foreach ($file in $Images)
{
$Directory = $destinationDirectory + "Pictures\" + $file.LastWriteTime.Date.ToString('yyyy') + "\" + $file.LastWriteTime.Date.ToString('MMM')
if (!(Test-Path $Directory))
{
New-Item $directory -type directory
}
Copy-Item $file.fullname $Directory
}
I read the documentation about the Write-progress function but i really don't know how i'm supposed to manage it in this script