Datasheet

WORK WITH OUTPUT 31
Getting Started with
Windows PowerShell
Basics
PART 1
PS C:\> $sites1.Portal
http://portal
PS C:\> $sites1.”Team Sites”
http://teams
PS C:\> $sites1[“My Sites”]
http://mysites
PS C:\>
Work with Output
A er you’ve declared and set your variable or executed a speci c cmdlet, youre
likely to need to pass that information into another cmdlet or otherwise display the
results to the console in some formatted fashion. In the following sections, we will
review passing data between cmdlets and how to format the results in the console.
Understand the Object Pipeline and PipeBind Objects
Many scripting languages provide a mechanism to “pipe” output from one com-
mand to another. In the command prompt console, you can simply use the pipe
operator (
|
) to pass information between commands as shown in this example that
demonstrates how to  nd STSADM commands with the text user in them:
C:\>stsadm -help | find “user”
add-ecsuserdefinedfunction
addexemptuseragent
adduser
allowuserformwebserviceproxy
deleteuser
enumexemptuseragents
enumusers
getsiteuseraccountdirectorypath
migrateuser
remove-ecsuserdefinedfunction
removeexemptuseragent
setsiteuseraccountdirectorypath
userrole
stsadm.exe -o adduser
-userlogin DOMAIN\name
c01.indd 31c01.indd 31 5/16/2011 11:12:34 AM5/16/2011 11:12:34 AM