What is Windows PowerShell?

May 19, 2006

One of the first question on the microsoft.public.windows.powershell newsgroup was "What is Windows PowerShell?".

Windows PowerShell is a new Windows command shell, designed to provide a new, more flexible, more powerful command shell than the current Windows command shell based on CMD.exe. It is designed to produce a more efficient command line experience for Windows administrators and power users.

Windows PowerShell is based on the .NET Framework. It uses object-based pipelines to allow you to combine commands to produce useful results.

Windows PowerShell is also a powerful scripting language. It uses cmdlets (pronounced command-lets) which can be composed in pipelines. Each step in a pipeline is separated by the | character. For example, to find all running services on your machine use the following command:

get-service | where-object {$_.status -eq "running"}

This pipeline has two steps. In the first step you use the get-service cmdlet to retrieve information about all services on the local machine. In the second step you use the where-object cmdlet to filter the objects from the first pipeline step. The code in the curly brackets, {$_.status -eq "running"}, tests whether the value of the status property of the current object, $_, equals running. If it does then the object is passed to an implicit third step in the pipeline which displays the results. Objects whose status property does not equal running are discarded.
Pipelines can have many steps to, for example, allow you to filter, sort, group objects.

Results can be displayed using the default formatter or you can take more control of how output is displayed by using formatting cmdlets such as the format-table and format-list cmdlets.


2 Responses to “What is Windows PowerShell?”

  1. Well, I’m learning more and more, just read my bookud83dude00. Click https://twitter.com/moooker1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: