PowerShell - fast remove a directory with 10,000+ files
May be try this:
#solution 1 - Remove content of dir 
remove-item &quot;C:\temp\tmp2\*&quot; -Recurse -Force

#Solution 2 - Remove dir and recreate dir
remove-item &quot;C:\temp\tmp2\&quot; -Recurse -Force
New-Item &quot;C:\temp\tmp2\&quot; -ItemType Directory

#Solution 3 - Loop into dir and remove all with intercept error
Get-ChildItem &quot;C:\temp\tmp2\&quot; -Recurse | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue