Why I Hate the GUI (Part I)

 

You know, this whole “why do we need a shell [meaning PowerShell] when we have a perfectly good GUI?” is a sentiment I really have trouble understanding. Literally – I can’t wrap my head around the premise. I guess that’s because I started with computers back in the MS-DOS days, when the command-line was all we had. Even when Windows 3.0 (the version version I installed) shipped, I was constantly dropping down to DOS – the real OS – to tweak Config.sys and AutoExec.bat. I’ve always felt that the GUI was a layer between me and the operating system.

I’ll give you a perfect example: In Windows NT 3.51, you could open the Server Manager application, click on a server, and get a list of open resources. Now, scrolling through a dialog box full of open resources is no fun, but it was the only way to find out who had a given file open at a particular time. Then I discovered VBScript, and I wrote a script which did essentially the same thing, only much faster. And with less boredom. And with fewer mistakes – in a list of thousands of entries, it’s easy to miss the one you were looking for. Yay, scripting! Which, really, was getting “under” the GUI.

With PowerShell, it’s even easier. I might have a cmdlet called Get-Resources and write something like this:

Get-Resource | Where {$_.Path = "c:\file"} | select username

Easy, easy! Of course, this doesn’t really work – I haven’t written a Get-Resource cmdlet, yet (hmm…). The point is that this simple command (and okay, maybe it’s blurring the line between a shell and scripting, but any Unix admin would call this a “command”) replaces dozens of lines of VBScript and replaces hours of my life spent scrolling through lists. I hated that GUI. And that is why PowerShell is so important to me.