PowerShell: Delete Directory

By Xah Lee. Date: .

Delete Directory

# delete a dir
rm .\dirName
# PowerShell may prompt to confirm
# delete a directory, force, no ask
rm .\dirName -Force -Recurse

If you cannot delete a dir because read only etc, see Get/Set File Attributes

PowerShell, Working with Directory

PowerShell

Practical How-To

list files

list dirs

on dir

on file

Windows config

zip tar

misc


PowerShell in Depth

Programing PowerShell

Value Types

String

Variable

Boolean

Conditional

Data Structure

Loop and Iteration

Input/Output

Function

Profile and Script

Script Examples