Tuesday, March 30, 2021

Powershell - Useful command

 Open Powershell as an admin!


How to delete all the "Debug" folders recursively

Get-ChildItem . -Include Debug\* -Recurse | Remove-Item -Recurse -Force


Get-ChildItem . -Include "x64\*" -Recurse | Remove-Item -Recurse -Force

Get-ChildItem . -Include "x64" -Recurse | Remove-Item -Recurse -Force


Get-ChildItem . -Include ".vs\*" -Recurse | Remove-Item -Recurse -Force

Get-ChildItem . -Include ".vs" -Recurse | Remove-Item -Recurse -Force


rmdir */Debug -Recurse -Force


or 

You can use the command tree /f to see a, well, tree, of all the nested files and folders:


use the /f flag to force delete the file del /f "Read Only Test File.txt"


How to delete folders with the rmdir command


To remove a directory, including all nested files and subdirectories, just use the /s flag:

Powershell - Useful command

 Open Powershell as an admin! How to delete all the "Debug" folders recursively Get-ChildItem . -Include Debug\* -Recurse | Remove...