Chapter 2. Windows PowerShell Command Types, Snap-ins, and cmdlets

Now that you've installed Windows PowerShell on your computer, I bet you can't wait to start running your own commands to unravel the power of Microsoft's new command shell. This chapter introduces you to the new PowerShell commands, or cmdlets. It also introduces you to the collections of cmdlets called snap-ins. By following all of the examples in this book, you will become comfortable working with the cmdlets, and you will even be able to tweak the output to your liking. First, however, this chapter gives you a quick-start on how to run PowerShell commands interactively.

This chapter covers the following topics:

  • PowerShell command types

  • PowerShell snap-ins

  • Syntax of cmdlets

  • Command chaining

  • Getting help

  • Filtering

  • Sorting

  • Formatting

PowerShell Command Types

When you launch a new PowerShell window, you are basically executing a small PowerShell.exe executable, which provides a command-line interface and issues instructions on how to make the functionality in the PowerShell Engine available.

Those instructions are written in .NET language and are available in the form of commands called cmdlets (pronounced "command lets"). All the cmdlets, when executed, process the instructions and return an object, not just text.

The following four different command types are available in the PowerShell environment. Don't panic. PowerShell understands and performs the different types of functions based on the type of commands that you execute. ...

Get Microsoft® SQL Server® 2008 Administration with Windows PowerShell™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.