Reputation: 59
Is it possible to delete multiple files with one command using powershell. i.e in unix you can do rm file1 file2
but when I try it in powershell I get "Remove-Item : A positional parameter cannot be found that accepts argument 'file2'". Same if I use del.
Upvotes: 1
Views: 49
Reputation: 86
You can separate the file paths with a comma, like this.
Remove-Item "test1.txt", "test2.txt"
There are also options for using wildcard characters, like
Remove-Item "test*.txt"
this will remove all files that match the pattern.
You can check more details in the command's documentation
Upvotes: 3