Remove files when first two characters are ZZ

Viewed 5992

I want to delete all the files when the first two characters are equal to zz or ZZ. How can I do it?

5 Answers

It's faster with -filter. Take off the -whatif when you're sure it's what you want.

get-childitem -recurse -file -filter zz* | remove-item -whatIf
Related