Datasheet
16 CHAPTER 1
•
WINDOWS POWERSHELL 101
COMMON PARAMETERS
Every Windows PowerShell cmdlet contains some common parameters. To see more
information about those parameters, type
help about_commonparameters
. The
common parameters are as follows:
-Verbose
-Debug
-WarningAction
-WarningVariable
-ErrorAction
-ErrorVariable
-OutVariable
-OutBuffer
-WhatIf
-Confirm
You will see the common variables
-ErrorAction,
-ErrorVariable
, and
-Confirm
used extensively in later parts of this book.
is rst example demonstrates how to return back all the SharePoint 2010 cmdlets:
PS C:\> Get-Command -pssnapin Microsoft.SharePoint.PowerShell
Running this example isn’t extremely helpful because it returns way too much
information.
For this next example, assume that you want to create service applications using
PowerShell and therefore you must see all the cmdlets that are related to services. e
easiest way to do this is to lter by the common string
SPService
, as shown here:
PS C:\> Get-Command -noun SPService* | Sort Noun | ft Name
Name
----
Install-SPService
c01.indd 16c01.indd 16 5/16/2011 11:12:32 AM5/16/2011 11:12:32 AM