I wrote some code to display progress of running “Get-ChildItem” command but In my opinion it is to big for such simple task. Could it be wrote in simpler way?
Despite of some minor issues and a little bit bad style … I assume it works for you or doesn’t it?
What’s the actual purpose of this code? Mostly we try to make our code to run as fast as possible. Therefore we wouldn’t use Start-Sleep if it’s not needed. But I assume you included it to actually see the effect of Write-Progress, right? I would write it probably this way: