Datasheet
UNDERSTAND THE COMPONENTS 19
Getting Started with
Windows PowerShell
Basics
PART 1
For technical information, type: “get-help Start-SPServiceI
nstance -full”.
Eventually, you’ll get to the point where the available cmdlets fail you and you must resort
to working with the object model. Again, the SDK is a great resource for you, but o en-
times, just seeing a list of available methods and properties is enough to get you started.
You can use the
Get-Member
cmdlet to return a listing of all the properties and
methods that you can work with. e parameters for the
Get-Member
cmdlet are
listed in Table 1.2.
TABLE 1.2
Get-Member
parameters
Parameter Description
Name
Provide the name of one or more properties or methods to return back informa-
tion about that property or method. If you use the
Name
parameter with the
-MemberType
,
-View
, or
-Static
parameters,
Get-Member
gets only the
members that satisfy the criteria of all the parameters.
Force
Adds the intrinsic members (
PSBase
,
PSAdapted
,
PSObject
,
PSTypeNames
)
and the compiler-generated
get_
and
set_
methods to the display. By default,
Get-Member
gets these properties in all views other than
Base
and
Adapted
,
but it does not display them.
InputObject
Specifi es the object whose members are retrieved. When using an array of objects,
setting
-InputObject
via the pipeline results in the members of the individual
objects of the array being returned, whereas setting
-InputObject
as a param-
eter results in the members of the array being returned and not its contents.
MemberType
Gets only members with the specifi ed member type. The default is
All
.
Static
Gets only the static properties and methods of the object.
View
Gets only particular types of members (properties and methods).
To use this cmdlet, you must pass an instance of the target object into it:
PS C:\> Get-SPSite http://portal | Get-Member
You can pass in additional parameters to the
Get-Member
cmdlet either to lter the
results down to just properties, for example, or to see the original members of the
.NET object without any extension or adaptation. Type extensions and adapters are
explained later in this chapter.
c01.indd 19c01.indd 19 5/16/2011 11:12:32 AM5/16/2011 11:12:32 AM