Skip to Content

Remove-Item


Description
Deletes the specified items.
Syntax
Remove-Item [-Path] <String[]> [-Recurse] [-Force]
Example
Remove-Item -Path 'C:\temp\*' -Recurse -Force
Parameters
Path: Required. Specifies a path to the items to delete
Recurse: Optional. Deletes items in specified locations and all child items
Force: Optional. Forces deletion of read-only or hidden files
Return type
None
Aliases
ri, rm, rmdir, del, erase, rd
Supported Windows versions
Windows PowerShell 2.0 and laterWindows 7Windows 8Windows 10Windows 11Windows Server 2008 R2 and later