Practical Powershell. Today we will be using Powershell to help you with day-to-day tasks. We are going to explore how to create a Powershell script to delete old files on your hard drive. Like I have said before , I enjoy Powershell and like how it gives me more control over my computer, particularly how it makes mundane tasks a lot more simple [and fast] for me to do. The good news is that if you don't have a lot of experience with Powershell, it is quite easy to extend and build new features using the language. Powershell (not the official logo) Let's get started. Writing the script In order for us to delete all of the old files from our hard drive, we need to be able to somehow find all these old files. A better question to ask would be; "what qualifies a file as old?" For the purposes of this example, let's assume that any file that has not been modified in the past 3 years be marked as "old" and should be deleted. Great - now how do w...
A technology blog where we explore concepts related to software and web development, sql, c#, powershell, .net core, programming advice, interview questions and other topics.