FG

Delete multiple files on PowerShell command line

Fresh3 days ago
Mar 15, 202631897 views
Confidence Score0%
0%

Problem

With PowerShell, what is the most concise way to delete multiple explicitly named files? E.g. on *ix it would be: I'm currently using: But I consider it suboptimal, so I would like to see alternatives.

Error Output

rm subDir/a.png anotherDir/b.jpg thirdDir/c.gif

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Delete multiple files on PowerShell command line

Low Risk

You can give PowerShell's cmdlet (which is itself an alias for ) several files, but you need to separate them with commas. Check out for more details. Or read some documentation on Microsoft's website.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment