Datasheet

UNDERSTAND THE COMPONENTS 15
Getting Started with
Windows PowerShell
Basics
PART 1
can be especially di cult when that task requires the use of several cmdlets that
must be executed in a speci c order or when a speci c cmdlet for the task doesn’t
exist, thus requiring the use of the SharePoint object model.
In most cases, the best way to locate the cmdlets or .NET objects, methods, or
properties that you’ll need is to use the SharePoint so ware development kit (SDK),
speci cally the Index of SharePoint Server 2010 Windows PowerShell cmdlets
(
http://technet.microsoft.com/en-us/library/ff678226.aspx
), or
your favorite search engine. However, you can also do some basic searching within
the Windows PowerShell console. Two cmdlets facilitate this:
Get-Command
Get-Member
You can use the
Get-Command
cmdlet to return any and all cmdlets registered with
the Windows PowerShell console.  e parameters for the
Get-Command
cmdlet are
listed in Table 1.1.
TABLE 1.1
Get-Command
parameters
Parameter Description
Name
Gets information only about the cmdlets or command elements with the specifi ed
name. Wildcards are permitted.
Noun
Gets cmdlets and functions with names that include the speci ed noun. Wildcards
are permitted.
Verb
Gets information about cmdlets and functions with names that include the speci-
ed verb. Wildcards are permitted.
CommandType
Gets only the specifi ed types of commands. Use
CommandType
or its alias,
Type
.
By default,
Get-Command
gets cmdlets and functions. Valid values are
Alias
,
All
,
Application
,
Cmdlet
,
ExternalScript
,
Filter
,
Function
, and
Script
.
ArgumentList
Gets information about a cmdlet or function when it is used with the speci ed
parameters (“arguments”), such as a path. The alias for
ArgumentList
is
Args
.
Module
Gets the commands that came from the specifi ed modules or snap-ins. Enter the
names of modules or snap-ins, or enter snap-in or module objects. You can refer
to this parameter by its name,
Module
, or by its alias,
PSSnapin
. The parameter
name that you choose has no e ect on the command or its output.
Syntax
Gets only specifi ed data about the command element.
TotalCount
Gets only the specifi ed number of command elements. You can use this parameter
to limit the output of a command.
c01.indd 15c01.indd 15 5/16/2011 11:12:31 AM5/16/2011 11:12:31 AM