title: Powershell Delete all files apart from the latest file per day
body: <p>I have a folder that contains a lot of files, multiple files per day.</p>
  
  <p>I would like to script something that deletes all but the latest file per day.</p>
  
  <p>I have seen a lot of scripts that delete files over X days old but this is slightly different and having written no powershell before yesterday (I'm exclusively tsql), I'm not really sure how to go about it.</p>
  
  <p>I'm not asking anyone to write the code for me but maybe describe the methods of achieving this would be good and I can go off an research how to put it into practise.</p>
  
  <p>All files are in a single directory, no subfolders. there are files I dont want to delete, the files i want to delete have file name in format <code>constant_filename_prefix_YYYYMMDDHHMMSS.zip</code></p>
  
  <p>Is powershell the right tool? Should i instead be looking at Python (which I also don't know) Powershell is more convinient since other code we have is written in PS.</p>