Do you “get it?”

In his blog at http://4sysops.com/archives/free-windows-powershell-book-or-why-powerscript-would-have-been-a-better-name/, Michael has a lot to say about his first thoughts about Windows PowerShell. Unfortunately, I think he may have missed a few salient points, and may just not “get it” yet. That’s easy to do with PowerShell – it’s a new way of thinking about things, and it requires you to acknowledge some realities about Windows that many administrators just aren’t comfortable owning up to.

Actually, you could also say, it is an introduction into Windows Powershell from Microsoft. When I skimmed over the document, I came once again to the conclusion that Powershell is not really a shell, but just another scripting language.

It’s actually both, just like the shells used by most Unix admins (Bash and so forth). You can do incredibly powerful things with PowerShell without writing a line of script “code.” In fact, Cmd.exe is the same thing, no? It’s a shell, but it does have a (primitive) scripting language embedded in it, as well. I’m not sure a “skim” is the best way to learn about PowerShell <grin>!

This is at least true if you take the original meaning of the term “shell” which is just a user interface. Of course, you can also use Powershell on the command prompt. However, I doubt that many Windows sysops will really do this.

Wow, I couldn’t agree more. Why do most Unix admins choose to work from a command shell? Easier, more consistent, more efficient. Why have Unix admins always given Windows a hard time in manageability brownie points? The lack of a cohesive, complete command-line shell. I’ve been flying all over the country in the past few weeks – and will fly more in the weeks to come – teaching eager Windows sysops how to use PowerShell, and they’re loving it. Funny you should use the word “sysop,” in fact, Michael – I didn’t think anyone did anymore! But just this week I was teaching a bunch of sysops who work for Google (yup, they use Windows, and lots of it) how to use PowerShell – and believe me, they “get it.”

Consider this example from the book which lists processes by its name and CPU time:

get-process | ForEach-Object { write-host $_.ProcessName $_.CPU}

Who really wants to type such longwinded commands? Yeah, you could also just use “get-process” to get a (different kind of) list of processes. But why not just use task manager for this? The point is, you usually need such a formatted list of processes only if you want to use it as input for another command. And that’s what I call scripting and not working on the command shell. Therefore, a better name for Powershell would have been “Powerscript” in my view.

It’s easy to think thaty when you’re getting started. But consider this: You know what that’s doing, because those long-winded cmdlet names are very clear about what they’re up to. And if you want pithy:

ps | select ProcessName,CPU

Short-winded enough? As with any product, you do have to take the time to learn how to use it properly and efficiently. That was the case when you started learning Windows’ graphical user interface, as well, and the same applies for PowerShell.

I think that Windows doesn’t really need a powerful command shell because it has very powerful GUI tools. This is the main difference to Linux. However, there are some tasks you can’t even do with a powerful GUI. But then they are usually so complicated that a longwinded command won’t be of help either. That’s were scripts come in.

Well, I just couldn’t disagree more! Let’s take a simple example: Changing the logon name a service uses. Can’t do it through the GUI, and with PowerShell you don’t need to write a script. You can do it in one nice command line – if you know how to use the shell. Yes, learning is involved – it’s the IT industry; learning will always  be happening. Windows’ GUI, as I’ve said, makes Windows easy to use for one-off tasks; when you need to do something in batch, or consistently, or when the GUI presentation happens to be complex, Windows falls down. Yep, it’s a major difference from Unix or Linux – and it’s why those guys kill us in enterprise manageability. Hence, PowerShell.

On my blog someone asked why Sever Core doesn’t support Powershell. The official answer to this question is that Powershell needs .Net which is not supported by Server Core. Another reason is that Server Core wouldn’t probably benefit much from Powershell because it is a scripting language and not a command shell.

Michael, with all the respect in the world, you’re just dead wrong. It is a command shell – I suspect you just don’t have enough experience with it yet to realize that. You’re right in that Server Core won’t run PowerShell because of the .NET requirement; hopefully that’s something Microsoft will work on. However, I’ll suggest this: Windows admins need to get the heck out of this habit of managing servers from the servers’ console. Server Core is intended to be “headless;” you don’t log on to its console. You manage it remotely – something you could really do with any Windows server; Server Core just pushes the point harder. If you’re actually walking into your data center, you’re working too hard.

Now, leaving Michael alone for a minute, I want to make an observation: For folks whose chosen profession is an always-evolving one (e.g., IT), Windows admins seem remakrably reluctant to change their ways. Managing servers by logging onto the console has been a ridiculous, time-consuming, error-ridden process for years, and since at least 2000-2003, it hasn’t been necessary. Managing entirely from a GUI is also inefficient and inconsistent, although to date it’s still necessary – although PowerShell is the start of that changing. It’s frustrating for me to see people still doing things like walking into the data center to reboot a machine, or change a service, or create a user – but they still do it. Folks, if you decide you want to be stuck in time and use products like Windows in the most inefficient way they allow – well, more power to you! But products like Windows PowerShell are intended to fix what the rest of the industry has long perceived as grave shortcomings; if you don’t think a GUI is inefficient or inconsistent, then you don’t have to change – but recognize that tens of thousands of people disagree with you, so there’s the slightest chance you might be mistaken.

I hope every Windows administrator takes some time to really learn what PowerShell is about (not just a quick skim, although that’s certainly a great start). Be a professional in the IT industry. Accept that the way we’ve always managed Windows isn’t because that way is better – it’s because that way is all we had. Turn to operating systems like Unix – which have a 20-year head start on us in manageability – and learn a few lessons. Take the best of what they offer, and keep the best of what Windows offers – which is why I truly believe PowerShell is doing.