

When running in a local PowerShell session DIR will not try to follow the NTFS Junction. After some fiddling around it appears as DIR get’s into an infinite loop when recursively listing ‘C:\Users\Username\AppData\Local\Application Data'. I found a bug when using DIR over PowerShell Remoting. There you go Dir.exe is 3.79x faster than Get-ChildItem on my notebook with SSD.

Measure-Command | Select TotalMilliseconds So how fast are these commands actually? Which command should we use? Let’s use Measure-Command to find out:

This deviation seems to be the result of a growing VHD file in my homefolder. On the right-hand-side you will find a screenshot showing the properties of my homefolder. sum #Good old Dir, recursively (( cmd / c dir $home / -C / S / A:-D-L ) -split '\s+' ) #RoboCopy in list only mode: ( robocopy. #Use erroraction silentlycontinue to ignore access denied errors (` Get-ChildItem ` $home -Recurse -force -erroraction Silentl圜ontinue | Measure-Object length -Sum ).
