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.
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.
Computer Type: Laptop System Manufacturer/Model Number: Dell Inspiron 7779; HP Pavilion TP01-0026na desktop; Chuwi Hi10 Pro OS: Windows 10 Home x64 Version 22H2 Build 19045.4170 Internet Speed: 4G, AX WISP router and AX phone hotspot Browser: Firefox, some use of Edge Antivirus: Defender
Did Microsoft kill the ability to delete items from your desktop using the keyboard? Because Del or Shift+Del are no longer working on my desktop icons. :confused:
I have had issues with windows taking folder and file permissions from me for random and non-windows items like ShareX. I've tried looking online for answers but none of them have really given me the ability to regain ownership and make alterations...
I have been asked on how to be able to delete a system report .zip file that has been created with Acronis 2019 which when trying to delete it, it says “you do not have permission” although there is only one user account.
Help will be most...
In D: drive i have the old windows. I didn't uninstalled them i just installed new windows on C:
The drive D: was C: but now the drives switched.
Now in C: i have the new installed windows 10 and it's working fine.
But on D: i have the old...
I have just bought a Surface 4 Pro with k'brd. I find that one old program will no longer run correctly, so need to make a Batch file to replace it.
Windows 10 screen capture produces files all with the same name, appending a serial number.
...