Windows admin’s heaven: chocolatey.org

Recently, Microsoft issued Windows Management Framework v5 preview, which introduces a Powershell module called OneGet: “OneGet is a new way to discover and install software packages from around the web.”

OneGet itself in its first version introduces the repositories from chocolatey.org. To explain what Chocolatey is, the analogy to apt or apt-get in Debian linux is the easiest way. Need Notepad++, cygwin, Foxit reader, 7zip, Firefox, Sysinternals tools and many more on your machine(s)? Tired of visiting each and every website or fiddling with a bunch of update mechnanisms that sometimes work and sometimes don’t? There comes Chocolatey. Install all of them with a few keystrokes, and keep them up to date with even less. Made my day.

How to delete files older than x

Something I regularly need to do is search for files that are older than a certain amount of time and do something with them, like move or delete. Here’s a handy snippet how to do it in PoSh.

The question mark is an alias for Where-Object, -le means “less than or equal”, and AddMinutes has close relatives like AddDays… just use the autocomplete via the tab key after “Add” to get more.