Had to delete a bunch of old files sitting in a directory, with files going back to 2013. Running
Write-Host (Get-ChildItem c:\a_directory\completed | Measure-Object).countreturned there were 165,880 files in there. This many files makes it difficult to use explorer to sort and delete, so powershell is where I turned.
Running
Get-ChildItem -Path "C:\a_directory\Completed" -Recurse | Where-Object{$_.CreationTime -lt(Get-Date).AddDays(-2000)}showed me I had files going all the way back to 2013. Piping that to Remove-Item, thus the full command being
Get-ChildItem -Path "C:\a_directory\Completed" -Recurse | Where-Object{$_.CreationTime -lt(Get-Date).AddDays(-2000)} | Remove-Itemcleared those files out.