I want to do a progress bar of my script but then I need a total amount of folders.
Is there a significant runtime difference between:
Get-ChildItem
You can check for yourself:
Measure-Command { 1..100000 | ForEach-Object $_ } 1.17s Measure-Command { foreach ($i in (1..100000)) { $i } } 0.15s