Dueling Command Lines
Command prompt or PowerShell? Longhorn will give you both.
May 7, 2007
In this corner, in the black trunks, we have the reigning champion--that last unwelcome reminder of MS-DOS still lingering in our beloved Windows NT-based OS. You know him as "Windows Command Prompt," or cmd.exe. [Cheers, boos erupt from the audience.]
In the other corner, in the modern-looking navy blue trunks, we have the cocky young newcomer, a Microsoft .NET-based based bit of developer mashup that administrators both fear and respect. He's "Windows PowerShell," and he's breathing down Command Prompt's aging virtual neck like a freight train barreling down the track. [Scattered cheers, noncommittal murmuring as audience members look askance to see if everyone else is as unclear about PowerShell as they are.]
And this, ladies and gentlemen, is the situation in which we find ourselves. Microsoft, finally, has gotten the command-line bug, and big time. The only problem is, it's offering admins, IT professionals, developers, and other power users two competing command-line environments: one old, one new, one based in the murky past, one wrapped in the richness and goodness of Microsoft's modern developer frameworks. It should be obvious which you'd want to focus on, right?
To help you make the decision, consider that Wikipedia, voted least likely to be accurate in its high school year book, notes that the old command prompt will be replaced by PowerShell in 2007 but is present in Windows Vista "for backwards compatibility" reasons only. Oh, were that so. It would make life so much simpler. But the reality, sadly, is somewhat more complicated.
In Windows Server code name "Longhorn," the major version of Windows Server due late this year, Microsoft has provided users with both the command prompt and PowerShell. But here's the thing: PowerShell is a late addition. Indeed, as recently as a day-long December 2006 Windows Server briefing, Microsoft was telling me and others that PowerShell wouldn't be included in Longhorn Server.
To bolster this claim, Longhorn Server includes some amazing new command prompt-based utilities. Chief among these are servermanagercmd.exe, which Microsoft tells me provides 100 percent of the functionality of the new Server Manager GUI, but in a scriptable, automatable command-line version. And then there's the most tantalizing evidence of all: Server Core, arguably the most exciting new Longhorn Server feature, uses the command prompt, and only the command prompt, as its native interface. And Microsoft even created a new Server Core-specific command-prompt utility, oclist.exe, for managing virtually all of Server Core's workloads. (A new version of dcpromo.exe is used to set up the server as a domain controller--DC--using an answer file.)
In the face of this sudden rush to make the command prompt more relevant than ever, Microsoft dropped a bombshell with the recent release of Longhorn Server Beta 3: The company has changed its mind, and PowerShell will be included in the product after all. Sadly, the addition of PowerShell to Longhorn comes a bit late in the game for, say, a PowerShell version of servermanagercmd.exe, but Microsoft is looking to the future for a community of PowerShell enthusiasts to fill that and other management voids. And though the company isn't providing any details, it's working to create the subset of the .NET runtime needed to get PowerShell working in Server Core. It's only a matter of time.
So we have a temporarily revitalized command prompt and a vastly more useful PowerShell, which, while technically complex, will eventually provide Windows with a first-class command line and scripting environment that dramatically surpasses what's available today even in UNIX. And there are rumors that Microsoft will begin building Windows Server components the UNIX way: command line first, with GUI tools built on top of the command-line stuff. Sacré coeur.
Here's the problem. I don't have to tell you how overworked you already are, and now that you have two command-line environments to worry about in Longhorn Server, your life is going to get harder than ever. The timing is just bad, and my fear is that concerns about this and other big changes in Longhorn Server will slow the growth of this version. So although I'm sure PowerShell is the future, it's not the immediate future. And for the next few years, at least, you're going to want to wrap your mind around two command-line environments.
About the Author
You May Also Like