As a developer, I have many bin and obj folders that I would like to cleanup to reclaim some space. I can use this script:
Get-ChildItem . -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
However, to be safe, I only want to delete them if in the folder that contains bin or obj folder, there is a file with .csproj or .sln extension. Is it possible?