Hey PowerShell Guy !,How Can I Delete All the Files in a Folder Except for the Most-Recently Created File?
Another Hit-in-one(liner) translation from a ca 30 lines VbScript example :
How Can I Delete All the Files in a Folder Except for the Most-Recently Created File?
del *.* -Exclude (dir | sort creationtime -desc)[0] -whatif
Remove the -WhatIf to actualy delete the files.
Enjoy,
Greetings /\/\o\/\/