SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
Upcoming SlideShare
Loading in...5
×
 

SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators

on

  • 167 views

An introduction to the PowerShell scripting language for SharePoint developers and administrators.

An introduction to the PowerShell scripting language for SharePoint developers and administrators.

Statistics

Views

Total Views
167
Views on SlideShare
167
Embed Views
0

Actions

Likes
2
Downloads
30
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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.
  • http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?PageType=4&ListId={72C1C85B-1D2D-4A4A-90DE-CA74A7808184}&pID=524http://msdn.microsoft.com/en-us/library/ee557362.aspxSee Assignment collections - http://technet.microsoft.com/en-us/library/ff607664.aspx
  • Once used a choice column’s values instead of a CSV
  • Windows PowerShell in Action by Bruce Payette, V2Since then Hicks and Jones have written some good books too
  • http://technet.microsoft.com/en-us/scriptcenter/default
  • http://www.codeplex.com/psbb
  • Blog.blumenthalit.comBlog.blumenthalit.com/files/powershellhttp://blog.blumenthalit.com/blog/Lists/Posts/Post.aspx?ID=161, etc
  • 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!

SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators Presentation Transcript

  • Michael Blumenthal PSC Group, LLC
  • No Compiling! No Packaging! Just Code & Go!
  • • It’s Easy to Get Started!1 • Learn the PowerShell Syntax2 • Real World Examples3 • More Resources4 • Q&A5
  • Chapter 1
  • Windows Server 2003 • Download Windows Server 2008 • Install Server2008 R2 + • Run (Add ISE) • Upgrade to V4
  • Chapter 2
  • Symbols & Keywords Using the SharePoint API Creating and Running Scripts
  • • Variables1 • Commands2 • Piping3 • Comparisons4 • Flow Control5 • Filtering6
  • Symbol Called Symbol Called $ Dollar sign, money _ Underscore # Hash, Pound [ ] Square Brackets | Pipe, vertical bar . Dot, point, period { } Curly braces < > Angle Brackets “ Double Quote, tick - Dash, hyphen, minus : Colon % Percent sign ( ) Parentheses ; Semi-colon + Plus = Equals, is ! Bang, not /, Slash, backslash 1$#|
  • • Case Insensitive, Dynamic typing $foo $true, $false, $profile, $null $foo = “Hello, World” 1
  • Verb-Noun Built-in, Extensible Get-Help & Help Get-Member 2
  • Output Of Command 1 Input of Command 2 3
  • 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)
  • 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
  • 6 •Where {<Test>}Syntax • V1&2:Dir | Where {$_.Name – like “B*”} • V3:Dir | where Name –like B* Example
  • • Getting an SPSite1 • Manipulating It2 • Cleaning Up3
  • SPField SPListItem SPList SPWeb SPWebApplication SPFarm
  • Loading SharePoint DLLs C:...14 or 15CONFIGPOWERSHELL RegistrationSharePoint.ps1
  • SPWeb SPSite Inline In Script
  • Chapter 3
  • • 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
  • • Sync Wep App Properties8 • Install SharePoint9 • Repeatably Manage Content10 • Update Field Definitions11 • Edit MP3 Metadata, Make Flashcards 12
  • .filename.ps1 Set-ExecutionPolicy Unrestricted
  • Chapter 4
  •  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
  • It’s Easy to Get Started! Learn & Use the PowerShell Syntax More Resources In Review…
  • • Michael Blumenthal SharePoint Architect PSC Group, LLC • MBlumenthal@psclistens.com • psclistens.com • www.cspug.org • Twitter: @MichaelBL • SPYam Thank you for your time today.