Using forfiles to delete files, Need report first

Page 2 of 2 FirstFirst 12

  1. Posts : 26
    Windows 11 Pro 64-bit 22H2 22621.1
       #11

    garlin said:
    Good work, and here's some points for improvement:

    1. This script uses the ternary operator [? A : B], therefore requires PowerShell 7 to run, and needs to clearly declare:
    Code:
    #Requires -Version 7.0
    Obviously, those expressions could be rewritten to work under PS 5. Please consider how many average W10 users won't have PS 7.

    2. Allow the user to sort by file age, in either direction. Right now, it's fixed to ascending and users are more likely interested in seeing the oldest files first.

    I'll update the script when I have some free time. In the meantime, feel free to modify it to your liking.
      My Computer


  2. Posts : 17,016
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #12

    Recluse said:
    Before i run it i would like to see a report showing the files that will be deleted and total space freed up.
    I suggest that you would benefit from defining what decisions your report might led to.
    Doing so would reveal whether or not the report was worthwhile.
    Doing so might also hint at methods of automating the decision-making process & subsequent actions.


    All the best,
    Denis
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:52.
Find Us




Windows 10 Forums