Skip to main content

Posts

Showing posts with the label cmdlet

How to become a better programmer

I'll be the first to admit, programming was never something I found easy. My very first experience in programming was when I got this book at the ripe age of 11. I liked playing my Nintendo 64  and wanted to make games on my own. The book that changed it all for me My ability was far under sub-par. Somewhere in these  forums I wrote a post asking for help trying to understand a while loop - needless to say I got defensive because I felt I was being talked down by people smarter than me, telling me that I should start and learn more simpler things first (than dive right into making a PC game). Forums did actually look like this (circa 2005) The truth was, I was being too ambitious. BUT - TwisterMan was not going to code itself! (All drawn in glorious Microsoft Paint :)). Animation frames of TwisterMan doing some whirlwind attack Watch out for spikeo ! *rawr* And whoever this boss was called... Baaaa? The point I'm trying to get across i...

Deleting old files with Powershell

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...