Delete Selected Files from Deep in Sub-Folders

I am a newbie to Powershell, so I appreciate any help that’s offered. I have a removable drive that has files scattered throughout that I need to remove. The files all end in either .tmp or .eking

I have been trying to get Powershell to do that, but I am sure I am doing something wrong because the files are never deleted after I run what I think is the right command. So I thought maybe the best plan would be to post the path to the deepest subfolder and a file there that needs to be removed, and then ask if someone could post the syntax I should be using to delete files like the example.

The path to the file is: M:\Peppermill-Sync-Files Backup\All-Jon+Sue-Documents\Neahtawanta Buildings & Grounds\Performance Questionnaires 2017-2018\*.tmp

I would like to not have to run the delete command over and over for the specific end-directory…ideally I would have Powershell delete all files that end in *.tmp or *.eking from any directory or sub-directory under M:\Peppermill-Sync-Files Backup…what would be the syntax to do that?

Again, I very much appreciate the Forum’s help.

Welcome to the forum. :wave:t4:

What command did you use? Actually the syntax for such a simple task is pretty forward. If you have code you’ve got stuck with you should post it here (formatted as code) along with the error you might get and an explanation of what’s not working as expected and we will be happy to try to help you.
You may start with reading the help for the cmdlet

You should read the help completely including the examples to learn how to use it.

Thank you Olaf. As I looked further I had not realized that the attribute was set for the files I was trying to delete…I had set the Folder Option to “View Hidden Files” so I thought that doing that removed the attribute, which I now realize was incorrect. I ran a command to hidden folders, and then the command, and the files I needed to remove are now gone, and my problem is solved. Thanks again.