Preface:
This is a self-answered question, which is why there's no solution attempt in the question itself.
The task description is a focused reformulation of this now-deleted question.
I have a large set of files whose names contain version numbers; e.g.:
FileBam-0.10.1.zip
FileBam-0.2.0.zip
FileBoozle-1.7.2.zip
FileBoozle-1.7.5.zip
FileBoozle-1.7.10.zip
FileWam-0.97.40.zip
OtherFile-5.5.zip
Using PowerShell, I'd like to:
- group the files by shared named prefix, e.g.
FileBam - weed out groups that have only 1 element
- in each remaining, 2+-element group, delete all files except the one with the most recent version.