Datasheet
Chapter 1: Getting Started with Windows PowerShell
5
Common Shell Limitations
The traditional shells mentioned earlier offer an administrator greater control and flexibility for tackling
everyday or even unusual management tasks, but they all suffer from significant drawbacks.
Command shells operate by executing built - in commands that run within the process of the shell, or
by executing a command or application in a new process outside of the shell. Many applications lack
command - line equivalents for controls found in their GUI management programs. And the number
of built - in commands offered by most shells is usually small, requiring more applications and utilities
to run outside the shell to accomplish critical tasks. Most organizations lack the resources to develop
special applications and utilities on their own and may struggle to accomplish more complex tasks using
available commands alone.
Another drawback shared by most shells is the way in which they handle information. The results of
running a command or utility is returned as text to the command line. If you need to use this text as
input for another command, which is common in scripting, it has to be parsed. Parsing is the process of
evaluating text and extracting the meaningful values in a form that can then be properly interpreted by
another command. Parsing is prone to error and can be time consuming because the format required for
preparing the textual input can vary greatly between different commands, applications, and utilities.
One final limitation to consider is the lack of integration between a shell and the scripting languages you
would use in that shell. For example, Windows Script Host provides a method for implementing a
variety of scripting languages from the command line (via
cmd.exe ), but it is not integrated with
cmd.exe and is thus not interactive. It also lacks readily accessible documentation from the command
line as you would find in many other shells and scripting environments.
The Power Behind PowerShell
What sets Windows PowerShell apart from all other command shells is that it is built on top of .NET
Framework version 2.0. Windows PowerShell exposes .NET classes as built - in commands. When these
commands are executed they create a collection of one or more structured objects as output. Instead of
text, all actions in Windows PowerShell are based on .NET objects.
Windows PowerShell objects have a specific type based on the class used to create them. They have
properties (which are characteristics) and methods (which are actions you can take). Because objects
have a defined structure, a collection of objects created by one command can be passed to another
command as input without the need for parsing the data in - between.
Windows PowerShell includes a fully integrated and intuitive scripting language for managing .NET
objects. The language is consistent with higher - level languages used in programming .NET. Those
administrators familiar with the C# programming language will find many similarities in the grammar,
syntax, and keywords used by the Windows PowerShell scripting language.
Windows PowerShell includes more than 130 built - in commands for performing the most common
system administrative tasks. The commands are designed to be easy to understand and use because they
share common naming and parameter conventions. Learning how to use one command makes it easy to
understand how similar commands are also used.
c01.indd 5c01.indd 5 12/17/07 3:19:24 PM12/17/07 3:19:24 PM