Damon Cortesi's blog

Musings of an entrepreneur.

Windows Powershell

| Comments

I’ve been watching with anticipation as Windows PowerShell has gone from its infancy (which was pretty weak, in my opinion) to a tool that could really change how I use Windows.  Many of you know that I am a command-line junkie.   If there is a way to do something via the command-line, I will find it and I will script it.  That’s just how I am.  One thing that’s always frustrated me about Windows, however, is the shoddy access to the event viewer.  The GUI is just unbearably slow when you have thousands of events and you’re trying to scroll to a particular day’s log.  So I was really happy today to see this post about DateTime Utility Functions over on the Powershell blog that, with a little one-line function, makes getting recent events as simple as a little

PS> get-eventlog application -newest 2048 |where {isWithin -2 $_.TimeWritten}

Not bad…not bad at all.  This could become quite useful.  I applaud thee, Microsoft, for realizing that the command-line is still an important aspect of system administration and working towards a utility that can make life even easier then good ‘ol .bat files. My only problem with PowerShell now - function names are too verbose.  With UNIX, it is fairly easy to remember ‘ls’ and ‘cut’ and ‘sort’ and stuff like that.  But PowerShell has all this random stuff like “Copy-Item” and “[DateTime]::Now.AddDays” that make PowerShell more of a “programming” language than a “scripting” language, but perhaps I just need to work with it more…