Ezine 150 - Compare PowerShell with the Windows GUI
Ezine 150 - Compare PowerShell with the Windows GUI
The killer reason for learning PowerShell is to make life easier when configuring the latest Windows systems such as Exchange 2007 and Longhorn (Windows Server 2008). Furthermore, PowerShell is
useful here and now for adjusting settings in Windows Server 2003, Exchange 2003 and even XP.
PowerShell is many things to many people; but today I want to appeal to the enthusiastic amateur, the person who likes to take shortcuts, those who have longed to try computer scripting.
Revolutionary Idea
I have a revolutionary suggestion for evaluating PowerShell. Compare PowerShell not with other scripting languages, but with the Windows Explorer and its associated GUIs. Following this logic, the
benefit of learning PowerShell is that you will be able to launch the shell and type a few instructions which will configure your operating system. Yes you could use the equivalent GUIs, but you
may find this method takes longer, and also may not give you the precision of using the PowerShell commands. I realize that many people reading this will not believe that scripting will be quicker and easier than
the GUI, to them I say seek other evidence to support (or reject) my idea of using PowerShell as an alternative to a GUI.
Just as the airplane has not replaced the car, let me make it clear that I am not suggesting that you abandon the GUI, more that for any given task, you take the faster option. Another benefit of
using this dual approach is you experience a virtuous spiral where PowerShell teaches you about the operating system, while the operating system's GUI teaches you about PowerShell.
What's wrong with the GUI you ask? Well, nothing in
isolation, what could be clearer than a picture of what you are configuring complete with menus and buttons to make changes. The problem is that the GUI has become a victim of its success, in a nutshell there are too many
GUIs. With Exchange 2007 and Longhorn the drill-downs to find any particular feature have become labyrinthine. It's not uncommon that you need to remember a sequence of 5 levels before you
find the checkbox you are looking for.
Now it's not just me who says that systems like Exchange 2007, Longhorn, have too many menus, Microsoft engineers admit in private that when they want to change lots of settings
fast, they need an alternative to the GUI - enter PowerShell
Please don't misunderstand me, I am not saying that PowerShell will replace the GUI, more that it will complement
the GUI and provide a faster alternative for certain tasks. Indeed, there are parallels for a configuring an operating system from the command line - UNIX! Actually PowerShell has aliases so
that UNIX experts can type familiar commands in PowerShell, just to get them started.
My vision is for a change in emphasis of GUI : Command line. XP, Windows Server 2003 - 99% GUI : 1% Command line (DOS) Exchange 2007, Longhorn - 80% GUI : 20% Command line (PowerShell)
The above figures merely indicate the trend. One particular situation where I use the GUI and PowerShell in harmony, is when I issue my PowerShell command, I check if they have worked by
looking in a GUI. The menus and buttons also give me ideas for improving my PowerShell script.
Profile of PowerShell users
Let me suggest a profile of those who will gain most from learning PowerShell. Someone who is:
- Proficient with Task Manager
- A Veteran of Windows Explorer
- Likely to have gained experienced with Windows Services
- Has a passing knowledge of the eventlogs
- Possibly a minor expert with Active Directory Users and Computers
- Harbouring a secret desire to learn a scripting language
- Dabbling in other languages like VBScript, or DOS an advantage
Calculating IP Address
ranges is a black art, which many network managers solve by creating custom
Excel spreadsheets. IPAT cracks this problem of allocating IP addresses
in networks in two ways:
For Mr Organized there is a nifty subnet
calculator, you enter the network address and the subnet mask, then IPAT
works out the usable addresses and their ranges.
For Mr Lazy IPAT
discovers and then displays the IP addresses of existing computers.
Download the Free IP Address Tracker
PowerShell will Replace DOS / CMD.exe
Almost as a by-product, PowerShell will replace the old DOS / CMD shell. This realization may provide a useful entry into PowerShell; if you like issuing the occasional DOS command, then simply switch to PowerShell and run your old commands just as you did in DOS. Then one day you may want extra capabilities, you try a few basic
PowerShell command, you get hooked.
Dos Command: dir
PowerShell Equivalent: get-ChildItem | where {$_.length -gt "10000"}
The point about this way of entering the PowerShell arena is that you can stick in your comfort zone for as long as you want. Another reason that PowerShell it is easy to get started is because PowerShell
contains aliases for commands that you know already from working with DOS or Unix. The main
thrust of my argument is that it will be easy for you to achieve competency in PowerShell. I provide detailed examples on my website which enable you to interrogate the Task Manager, the Eventlogs, also to
configure Windows Services such as Print Spooler and Messenger. See lots of PowerShell scripts here
If you are looking for handy network utilities, try some of the free downloads at
Tools4Ever
Summary of PowerShell
You and I are never going to be experts in PowerShell, we have too many other roles to specialise solely in PowerShell. Now that statement may sound like a real downer, but it's meant to be; a) realistic, b) illustrate the depth in PowerShell, c) remind us that we can
just copy, paste and adapt scripts that ARE made by an expert. To take an analogy from tennis, anyone can hit the ball around the court, with practice and training you can beat your friends, but you
will never beat Nadal or Federer.
My point is that you should not just think of PowerShell as an alternative to VBScript, C++, Perl or PSP, but as a necessary compliment to the Windows Graphical User Interfaces. In addition, if you
look to the future with Longhorn and Exchange 2007 you will miss out if you don't know PowerShell.
If you like this page then please share it with your friends
See more Microsoft PowerShell tutorials
• PowerShell Tutorials •
Methods • Cmdlets
• PS Snapin •
Profile.ps1 • Exchange 2007
•
Command & Expression Mode •
PowerShell pipeline (|) •
PowerShell 'where' •
PowerShell 'Sort'
If you see an error of any kind, do let me know. Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.
|