Simple use of progress bar
suggest change1..100 | ForEach-Object {
Write-Progress -Activity "Copying files" -Status "$_ %" -Id 1 -PercentComplete $_ -CurrentOperation "Copying file file_name_$_.txt"
Start-Sleep -Milliseconds 500 # stand-in for the work, for example copying a file
}
The Start-Sleep call stands in for the work. You can run the example as it is, then replace that line.
This is how the result looks in the PowerShell console:
This is how the result looks in the Windows PowerShell ISE:
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents