简体   繁体   中英

Best way to delete a folder using PowerShell

Current I am using below command to delete the folder via PowerShell,

Remove-Item folderName -Recurse -Force

Am I following the best way or is there any best way to do it?

You can use following command to remove an empty directory

rmdir folderName

If you want to remove subdirectories and files use rm command with -r option -r means recursive.

rm -r folderName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM