Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Recursive, filtered Deleting

$
0
0

looking to recursively look through the backup sql folders and if the folder contains a file like *_MASTER* , and if it's the newest file in the directory, then delete all of the other files in the directory...i know you'd prob just sort by the create date grab the top one and see if that one has MASTER in it, if so, delete everything except the one that has MASTER in it. 

Just new to ps and can't figure out how to do this.

Thanks


Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images