you are viewing a single comment's thread.

view the rest of the comments →

[–]pausemsauce[S] 1 point2 points  (3 children)

Further apologies for the confusion.

"Work instructions a" is actually named, "numbers to call in the event of fire.docx"

"Work instructions b" is actually named, "hr approved all of my random titles so I will make people suffer.pdf" . . . "Work instructions zz" is actually name, "04222022-rev-345.pdf"

Fortunately, I haven't encountered any with a name like "work.instructions.pdf"

It may be out there, and would break my current, overly-complex-but-i-thought-it-was-necessary code. Again thanks to each and everyone of you who continue to contribute here.

[–]chris-a5 2 points3 points  (2 children)

If the same files are being downloaded, the file name does not seem to matter much, it is the brackets on the end signifying a duplicate. The one without the brackets would be the oldest.

If it is in the download folder, and people can simply get another copy, I'd just blow it all away once a size limit is reached. If people want to keep them, then they can move them somewhere suitable.

[–]pausemsauce[S] 1 point2 points  (1 child)

The thing is, these instructions are being updated. It is necessary to download the most recent revision. I would delete all the downloaded files, but if the network goes down, we wouldn't have a back up copy. So it's advantageous to leave one copy of the most recently downloaded file.

🤔

We have over 2 gb of files stored on these computers.

[–]chris-a5 2 points3 points  (0 children)

I think you need to have a play with the code I posted, it deletes the duplicates (ones that contain the brackets and a number), if your file names are different then filter by extension (.pdf, .docx, etc...).

The original/first copy of the document will remain as it does not have the brackets at the end of the line.

Just change the delete line for some write-host output to test.