manual
35 www.microsoft.com/sharepoint
A cmdlet is a simple command used for interaction with any managed application,
including the operating system. It is analogous to such shell commands as Cmd.exe, but
the processing of Windows PowerShell commands is very different. The traditional shell
generally processes commands as separate executable programs. Each program has to
parse the input, distinguish between positional and named parameters, bind values to
the correct parameters, format the output, and display the output. In contrast, Windows
PowerShell processes commands as instances of a .NET class, focusing on the simple
cmdlet model. You provide the parameters and validate the values, and then furnish
details of object types and formatting. Windows PowerShell does the rest of the work:
parsing the parameters, binding them to their values, formatting the output, and
displaying the output.
Cmdlet names are comprised of verbs and nouns, which denote their functional
properties. For example, the cmdlet name Get-SPSite combines the verb (command)
Get with the noun (object) SPSite to name the cmdlet that retrieves a specified
SharePoint SPSite object or collection. Cmdlet nouns take parameters as name-value
pairs that give specificity to the cmdlet noun; when invoked, the cmdlets return output
objects. The returned objects, in turn, have properties that are displayed as name-value
pairs.
The figure below shows the Windows PowerShell command-line window when the
Get-SPSite cmdlet has been invoked. The cmdlet uses a URL parameter in the form –URL
http://localhost
to identify the specific SPSite object it will retrieve. The cmdlet then
provides an equivalent name-value item that identifies the return object.
A cmdlet is not an executable; it is an instance of a .NET Framework class and therefore
it returns objects rather than a text stream. These objects can be passed (or "piped") to
another cmdlet as input, in sequence. In this way, cmdlets can be chained together,
providing enormous flexibility.