21. 4
Operator Meaning Operator Meaning
-eq Equals -le Less Than or
Equal To
-ne Not Equals -like Wildcard Match
-gt Greater Than -notlike Not (Wildcard
Match)
-ge Greater Than
or Equal To
-match Reg. Exp. Match
-lt Less Than -notmatch Not (Reg. Exp.
Match)
22.
23. 5
• For (Init;Test;Repeat) {Commands}
• for($i=1; $i -le 10; $i++) {Write-Host $i}For
• Foreach (Item in Collection) {Commands}
• Foreach ($web in $site.AllWebs) {$web.Title}ForEach
• If (Test) {Commands}
• if ($web.Title –ne “”) {Write-Host $web.Title}If
• While (Condition){Commands}
• while($val -ne 3){$val++; Write-Host $val}While
38. • Bulk Create Sites1
• List Item CRUD2
• Create data for test cases3
• Associate Workflows with a
List
4
• Work across site collections5
• Deployment Scripting6
• Identify files that won’t upload7
52. PowerShell Product Team
Blog
TechNet Script Center
PowerShell in Action by
Bruce Payette
CodePlex: PSBBs (mine)
CodePlex:SPInstaller
Blog.BlumenthalIT.Net
SharePointJack.com
• Jeff Hicks
• Gary LaPointe
• Raymond Mitchell
• Todd Klindt
• POSHCODE.ORG
• get-spscripts.com
• SPYam
53. It’s Easy to Get
Started!
Learn & Use the
PowerShell Syntax
More Resources
In Review…
54. • Michael Blumenthal
SharePoint Architect
PSC Group, LLC
• MBlumenthal@psclistens.com
• psclistens.com
• www.cspug.org
• Twitter: @MichaelBL
• SPYam
Thank you for your time today.
Editor's Notes
Every SharePoint Developer needs this!Fast and FlexibleGreat for Last Mile Problems. The MSFT standard for Scripting.
Who would like another tool in their toolbox, one that will help them with SharePoint, but also with many other things? How about the swiss army knife of tools?It will make you a better developer or administrator!
Who here already has installed and PowerShell? Who’s using Server 2003? 2008?Win 2003: http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspxWin 2008 – It’s an OS Feature – “servermanagercmd –install PowerShell”V4 is here
One is SharePoint aware, the other isn’t!
Does anyone have any other names for these?Victor Borge has his own take on these: http://www.youtube.com/watch?v=lF4qii8S3gw
Name that Language…Similar to @variables in SQL, apparently also Ruby, PHP.Arrays start at 0
Mention Aliases
Ask if anyone has unix scripting experience, and what they think of this.Can you imagine trying to do this in unix or vbscript?
Get-Help about_flow_controlMention that collections start at 0
Your mother doesn’t work here! You must clean up after yourself.
Also:PoshCode.OrgTechNet Script Center http://www.microsoft.com/technet/scriptcenter/default.mspx MSDN SharePoint Developer Center http://msdn.microsoft.com/en-us/office/aa905503.aspx Zach Rosenfield’s Blog - http://sharepoint.microsoft.com/blogs/zach/default.aspxhttp://blog.falchionconsulting.com/http://www.powergui.org/downloads.jspahttp://thepowershellguy.com/blogs/posh/pages/powertab.aspx
You owe it to yourself to try out PowerShell.It will make you a better developer or administrator!