Skip to content

How to Recursively Delete a Directory in PowerShell

If you want to recursively delete a directory/folder using PowerShell, then you have 2 options.

Option 1 – With LiteralPath and Force

Remove-Item -LiteralPath "myFolder" -Force -Recurse
Code language: JavaScript (javascript)

Option 2 – With implicit and Recurse

Remove-Item myFolder/* -Recurse

See also  Show the desktop's image name on a Mac
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x