SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Talbott Crowell
           July 28, 2012
SharePoint Saturday NYC #SPSNYC

     http://www.thirdm.com
            @talbott
•   What is PowerShell?
•   PowerShell Basics
•   Tools
•   PowerShell and SharePoint
•   Creating SharePoint 2010 Cmdlets
•   Iteration Style Scripts

                             www.sharepointsaturday.org/boston::WEB
                                            http://www.thirdm.com WEB
                               http://talbottcrowell.wordpress.com::EMAIL
                                          SPSBoston@live.com BLOG
                                                       @talbott : TWITTER
                                     @SPSBoston / #SPSBos : TWITTER
•   Unix-like shell
•   Object oriented
•   .NET
•   Command line
•   Scripting language



                         www.sharepointsaturday.org/boston::WEB
                                        http://www.thirdm.com WEB
                           http://talbottcrowell.wordpress.com::EMAIL
                                      SPSBoston@live.com BLOG
                                                   @talbott : TWITTER
                                 @SPSBoston / #SPSBos : TWITTER
• Windows PowerShell in Action
   – by Bruce Payette
     (designer and author of PowerShell)



• Windows PowerShell 2.0
  Administrator's Pocket Consultant
   – By William R. Stanek




                                           www.sharepointsaturday.org/boston::WEB
                                                          http://www.thirdm.com WEB
                                             http://talbottcrowell.wordpress.com::EMAIL
                                                        SPSBoston@live.com BLOG
                                                                     @talbott : TWITTER
                                                   @SPSBoston / #SPSBos : TWITTER
•   Automated build and deploy
•   Rapid prototyping
•   Exploring “What If” scenarios
•   Developer onboarding
•   Administration automation



                               www.sharepointsaturday.org/boston::WEB
                                              http://www.thirdm.com WEB
                                 http://talbottcrowell.wordpress.com::EMAIL
                                            SPSBoston@live.com BLOG
                                                         @talbott : TWITTER
                                       @SPSBoston / #SPSBos : TWITTER
• When you want to make your team more
  agile
  – Automation, automation, automation
• When developing, your daily build is like the
  projects heartbeat
  – PowerShell can be the pacemaker
• Testing
  – Use the PowerShell scripts to stand up an
    environment for running tests
                                  www.sharepointsaturday.org/boston::WEB
                                                 http://www.thirdm.com WEB
                                    http://talbottcrowell.wordpress.com::EMAIL
                                               SPSBoston@live.com BLOG
                                                            @talbott : TWITTER
                                          @SPSBoston / #SPSBos : TWITTER
• What do you know about a command line?
  – DIR
• How about
  – $a = DIR
• What is $a?
  – .NET Object
     • use gm or get-member to query properites
  – Array
     • $a[0]

                                     www.sharepointsaturday.org/boston::WEB
                                                    http://www.thirdm.com WEB
                                       http://talbottcrowell.wordpress.com::EMAIL
                                                  SPSBoston@live.com BLOG
                                                               @talbott : TWITTER
                                             @SPSBoston / #SPSBos : TWITTER
• PowerShell Basics
  – $a = DIR
  – $a | gm
  – Dates




                      www.sharepointsaturday.org/boston::WEB
                                     http://www.thirdm.com WEB
                        http://talbottcrowell.wordpress.com::EMAIL
                                   SPSBoston@live.com BLOG
                                                @talbott : TWITTER
                              @SPSBoston / #SPSBos : TWITTER
• cmd, notepad
• PowerShell Command
• Windows PowerShell Integrated Scripting
  Environment (ISE)
  – Import-Module ServerManager;
  – Add-WindowsFeature PowerShell-ISE
• PowerGUI
  – Download from powergui.org
                             www.sharepointsaturday.org/boston::WEB
                                            http://www.thirdm.com WEB
                               http://talbottcrowell.wordpress.com::EMAIL
                                          SPSBoston@live.com BLOG
                                                       @talbott : TWITTER
                                     @SPSBoston / #SPSBos : TWITTER
•   # for comment
•   Verb-Noun convention for commandlets
•   Write-Host “Hello World”
•   Set-ExecutionPolicy Unrestricted
•   .scriptname to execute



                            www.sharepointsaturday.org/boston::WEB
                                           http://www.thirdm.com WEB
                              http://talbottcrowell.wordpress.com::EMAIL
                                         SPSBoston@live.com BLOG
                                                      @talbott : TWITTER
                                    @SPSBoston / #SPSBos : TWITTER
• Comes with PowerShell Commandlets
  – Get-SPSite
  – New-SPSite
  – New-SPWeb
• If you are running from standard
  PowerShell
  Add-PSSnapin microsoft.sharepoint.powershell
  -ErrorAction SilentlyContinue

                              www.sharepointsaturday.org/boston::WEB
                                             http://www.thirdm.com WEB
                                http://talbottcrowell.wordpress.com::EMAIL
                                           SPSBoston@live.com BLOG
                                                        @talbott : TWITTER
                                      @SPSBoston / #SPSBos : TWITTER
• Get-SPSite
  – Parameter: url
• New-SPSite
  – Parameters: url, name, ownerAlias, template
• New-SPWeb
  – Parameters: url, name, description, template…
  – Other params:
     • -AddToTopNav or -UseParentTopNav
     • -AddToQuickLaunch

                                   www.sharepointsaturday.org/boston::WEB
                                                  http://www.thirdm.com WEB
                                     http://talbottcrowell.wordpress.com::EMAIL
                                                SPSBoston@live.com BLOG
                                                             @talbott : TWITTER
                                           @SPSBoston / #SPSBos : TWITTER
• Your friend STSADM is still there
• You can call STSADM or any command line tool
  from PowerShell
• You can write your own command line tools with
  .NET
• Better yet, you can write your own PowerShell
  Commandlets!
  – Inherit from Cmdlet or PSCmdlet
• Gary Lapointe has WSS and MOSS Cmdlets!
  – http://stsadm.blogspot.com/2009/02/downloads.html

                                      www.sharepointsaturday.org/boston::WEB
                                                     http://www.thirdm.com WEB
                                        http://talbottcrowell.wordpress.com::EMAIL
                                                   SPSBoston@live.com BLOG
                                                                @talbott : TWITTER
                                              @SPSBoston / #SPSBos : TWITTER
• When creating non-persistent tasks (i.e. get info)
  use:
   – SPCmdlet
• When objects persist between commands, use:
   –   SPRemoveCmdletBase
   –   SPNewCmdletBase
   –   SPSetCmdletBase
   –   SPGetCmdletBase
• For more info, see Gary Lapointe’s blog post:
   – http://stsadm.blogspot.com/2009/10/creating-
     custom-sharepoint-2010-cmdlets.html
                                    www.sharepointsaturday.org/boston::WEB
                                                   http://www.thirdm.com WEB
                                      http://talbottcrowell.wordpress.com::EMAIL
                                                 SPSBoston@live.com BLOG
                                                              @talbott : TWITTER
                                            @SPSBoston / #SPSBos : TWITTER
• [void][System.Reflection.Assembly]::LoadWith
  PartialName(”Microsoft.SharePoint”)
  – Load the assembly
• $SPSite = New-Object
  Microsoft.SharePoint.SPSite($url)
  – Reference to the site collection using SharePoint
    object model
• Don’t forget to
  – $SPSite.Dispose()
                                   www.sharepointsaturday.org/boston::WEB
                                                  http://www.thirdm.com WEB
                                     http://talbottcrowell.wordpress.com::EMAIL
                                                SPSBoston@live.com BLOG
                                                             @talbott : TWITTER
                                           @SPSBoston / #SPSBos : TWITTER
• Series of scripts to build your site
• Cleanup script to destroy site
• Edit script, run cleanup, run script, view
  site
  – Repeat




                               www.sharepointsaturday.org/boston::WEB
                                              http://www.thirdm.com WEB
                                 http://talbottcrowell.wordpress.com::EMAIL
                                            SPSBoston@live.com BLOG
                                                         @talbott : TWITTER
                                       @SPSBoston / #SPSBos : TWITTER
• Build2010.ps1
   – Calls other scripts
• Build2010_site_structure.ps1
   – Sets up the basic site structure and content types
• Build2010_upload_file.ps1
   – Uploads sample files to the site
• Build2010_set_logo.ps1
   – Adds site logo
• Build2010_add_users.ps1
   – Adds users to local machine and/or SharePoint groups


                                          www.sharepointsaturday.org/boston::WEB
                                                         http://www.thirdm.com WEB
                                            http://talbottcrowell.wordpress.com::EMAIL
                                                       SPSBoston@live.com BLOG
                                                                    @talbott : TWITTER
                                                  @SPSBoston / #SPSBos : TWITTER
• function Get-Theme
  ([Microsoft.SharePoint.SPWeb]$SPWeb,
   [string]$themeName)
• Strong typed parameters
• Returns
  Microsoft.SharePoint.Utilities.ThmxTheme


                            www.sharepointsaturday.org/boston::WEB
                                           http://www.thirdm.com WEB
                              http://talbottcrowell.wordpress.com::EMAIL
                                         SPSBoston@live.com BLOG
                                                      @talbott : TWITTER
                                    @SPSBoston / #SPSBos : TWITTER
• Upload File
   – Takes in 1 or more files
• Has 3 blocks
   – Begin
   – Process
   – End
• Process is executed for each file
• gci 'C:uploadfilesSamplesLegal' |
  .build2010_upload_file.ps1 -Location "shared/legal" -
  DocLib "Documents" -ContentType "Document" -
  MetaDataField "Dept" -MetaDataValue "Legal"

                                     www.sharepointsaturday.org/boston::WEB
                                                    http://www.thirdm.com WEB
                                       http://talbottcrowell.wordpress.com::EMAIL
                                                  SPSBoston@live.com BLOG
                                                               @talbott : TWITTER
                                             @SPSBoston / #SPSBos : TWITTER
• Windows PowerShell in Action
   – by Bruce Payette
     (designer and author of PowerShell)



• Windows PowerShell 2.0
  Administrator's Pocket Consultant
   – By William R. Stanek




                                           www.sharepointsaturday.org/boston::WEB
                                                          http://www.thirdm.com WEB
                                             http://talbottcrowell.wordpress.com::EMAIL
                                                        SPSBoston@live.com BLOG
                                                                     @talbott : TWITTER
                                                   @SPSBoston / #SPSBos : TWITTER
• How to: Build a SharePoint 2010 PowerShell Cmdlet
   – http://silverlight.sys-con.com/node/1370916


• Microsoft TechNet
   – http://technet.microsoft.com/en-us/library/bb978526




                                           www.sharepointsaturday.org/boston::WEB
                                                          http://www.thirdm.com WEB
                                             http://talbottcrowell.wordpress.com::EMAIL
                                                        SPSBoston@live.com BLOG
                                                                     @talbott : TWITTER
                                                   @SPSBoston / #SPSBos : TWITTER
• Please remember to turn in your filled out
  bingo cards and event evaluations for prizes.

• SharePint is sponsored by Summit 7 Systems
  across the way at the Hilton NYC.

• Follow SharePoint Saturday New York City on
  Twitter @spsnyc and hashtag #spsnyc

                                      22   | SharePoint Saturday New York City 2011
Thanks to Our Sponsors!
Talbott Crowell
           ThirdM.com
http://talbottcrowell.wordpress.com/
         Twitter: @talbott

Weitere ähnliche Inhalte

Ähnlich wie PowerShell and SharePoint @spsnyc July 2012

PowerShell and SharePoint
PowerShell and SharePointPowerShell and SharePoint
PowerShell and SharePointTalbott Crowell
 
2015 nouveaux outilsdevweb
2015 nouveaux outilsdevweb2015 nouveaux outilsdevweb
2015 nouveaux outilsdevwebPhilippe Antoine
 
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecerTDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecerStefan Teixeira
 
Power to the People: Manipulating SharePoint with Client-Side JavaScript
Power to the People:  Manipulating SharePoint with Client-Side JavaScriptPower to the People:  Manipulating SharePoint with Client-Side JavaScript
Power to the People: Manipulating SharePoint with Client-Side JavaScriptPeterBrunone
 
How to not blow up spaceships
How to not blow up spaceshipsHow to not blow up spaceships
How to not blow up spaceshipsSabin Marcu
 
Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...
Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...
Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...Weiai Wayne Xu
 
Lab305 Django Facebook Connect Integration Example
Lab305 Django Facebook Connect Integration ExampleLab305 Django Facebook Connect Integration Example
Lab305 Django Facebook Connect Integration ExampleMichael Trosen
 
Frontend tooling and workflows
Frontend tooling and workflowsFrontend tooling and workflows
Frontend tooling and workflowsDmitry Semigradsky
 
Identifying and solving enterprise problems
Identifying and solving enterprise problems  Identifying and solving enterprise problems
Identifying and solving enterprise problems Vasu Jain
 
Social Media Data
Social Media DataSocial Media Data
Social Media DataWill Simm
 
Building End User Productivity into your SharePoint Planning #BASPUG
Building End User Productivity into your SharePoint Planning #BASPUGBuilding End User Productivity into your SharePoint Planning #BASPUG
Building End User Productivity into your SharePoint Planning #BASPUGChristian Buckley
 
SELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query LanguageSELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query Languagebdeshong
 
Introduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and DevelopersIntroduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and DevelopersMichael Blumenthal (Microsoft MVP)
 
Life of a fragment of history
Life of a fragment of historyLife of a fragment of history
Life of a fragment of historyYvonne Perkins
 
Stop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard LibraryStop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard LibraryBrian Hogan
 
Automating everything with Microsoft Flow
Automating everything with Microsoft FlowAutomating everything with Microsoft Flow
Automating everything with Microsoft FlowJaap Brasser
 
BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017Cisco DevNet
 
Pwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShellPwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShellBeau Bullock
 

Ähnlich wie PowerShell and SharePoint @spsnyc July 2012 (20)

PowerShell and SharePoint
PowerShell and SharePointPowerShell and SharePoint
PowerShell and SharePoint
 
2015 nouveaux outilsdevweb
2015 nouveaux outilsdevweb2015 nouveaux outilsdevweb
2015 nouveaux outilsdevweb
 
Building a Reddit Clone from the Ground Up
Building a Reddit Clone from the Ground UpBuilding a Reddit Clone from the Ground Up
Building a Reddit Clone from the Ground Up
 
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecerTDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
TDC 2016 SP - 5 libs de teste JavaScript que você deveria conhecer
 
Power to the People: Manipulating SharePoint with Client-Side JavaScript
Power to the People:  Manipulating SharePoint with Client-Side JavaScriptPower to the People:  Manipulating SharePoint with Client-Side JavaScript
Power to the People: Manipulating SharePoint with Client-Side JavaScript
 
How to not blow up spaceships
How to not blow up spaceshipsHow to not blow up spaceships
How to not blow up spaceships
 
Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...
Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...
Curiosity Bits Python Tutorial: Mining Facebook Fan Page - getting posts and ...
 
Lab305 Django Facebook Connect Integration Example
Lab305 Django Facebook Connect Integration ExampleLab305 Django Facebook Connect Integration Example
Lab305 Django Facebook Connect Integration Example
 
Frontend tooling and workflows
Frontend tooling and workflowsFrontend tooling and workflows
Frontend tooling and workflows
 
Identifying and solving enterprise problems
Identifying and solving enterprise problems  Identifying and solving enterprise problems
Identifying and solving enterprise problems
 
Social Media Data
Social Media DataSocial Media Data
Social Media Data
 
Building End User Productivity into your SharePoint Planning #BASPUG
Building End User Productivity into your SharePoint Planning #BASPUGBuilding End User Productivity into your SharePoint Planning #BASPUG
Building End User Productivity into your SharePoint Planning #BASPUG
 
SELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query LanguageSELECT * FROM Internet: Using the Yahoo! Query Language
SELECT * FROM Internet: Using the Yahoo! Query Language
 
Introduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and DevelopersIntroduction to PowerShell for SharePoint Admins and Developers
Introduction to PowerShell for SharePoint Admins and Developers
 
Life of a fragment of history
Life of a fragment of historyLife of a fragment of history
Life of a fragment of history
 
Stop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard LibraryStop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard Library
 
Automating everything with Microsoft Flow
Automating everything with Microsoft FlowAutomating everything with Microsoft Flow
Automating everything with Microsoft Flow
 
Great 8
Great 8Great 8
Great 8
 
BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017BotCommons: Metadata for Bots - Devoxx 2017
BotCommons: Metadata for Bots - Devoxx 2017
 
Pwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShellPwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShell
 

Mehr von Talbott Crowell

Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Talbott Crowell
 
Developing a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint appDeveloping a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint appTalbott Crowell
 
Developing a provider hosted share point app
Developing a provider hosted share point appDeveloping a provider hosted share point app
Developing a provider hosted share point appTalbott Crowell
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#Talbott Crowell
 
Automating PowerShell with SharePoint
Automating PowerShell with SharePointAutomating PowerShell with SharePoint
Automating PowerShell with SharePointTalbott Crowell
 
SharePoint Saturday Boston 2010
SharePoint Saturday Boston 2010SharePoint Saturday Boston 2010
SharePoint Saturday Boston 2010Talbott Crowell
 
Architecting Solutions for the Manycore Future
Architecting Solutions for the Manycore FutureArchitecting Solutions for the Manycore Future
Architecting Solutions for the Manycore FutureTalbott Crowell
 

Mehr von Talbott Crowell (12)

Top 7 mistakes
Top 7 mistakesTop 7 mistakes
Top 7 mistakes
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
Developing a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint appDeveloping a Provider Hosted SharePoint app
Developing a Provider Hosted SharePoint app
 
Developing a provider hosted share point app
Developing a provider hosted share point appDeveloping a provider hosted share point app
Developing a provider hosted share point app
 
Introduction to F# 3.0
Introduction to F# 3.0Introduction to F# 3.0
Introduction to F# 3.0
 
Welcome to windows 8
Welcome to windows 8Welcome to windows 8
Welcome to windows 8
 
Exploring SharePoint with F#
Exploring SharePoint with F#Exploring SharePoint with F#
Exploring SharePoint with F#
 
Automating PowerShell with SharePoint
Automating PowerShell with SharePointAutomating PowerShell with SharePoint
Automating PowerShell with SharePoint
 
F# And Silverlight
F# And SilverlightF# And Silverlight
F# And Silverlight
 
SharePoint Saturday Boston 2010
SharePoint Saturday Boston 2010SharePoint Saturday Boston 2010
SharePoint Saturday Boston 2010
 
Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
Architecting Solutions for the Manycore Future
Architecting Solutions for the Manycore FutureArchitecting Solutions for the Manycore Future
Architecting Solutions for the Manycore Future
 

Kürzlich hochgeladen

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 

Kürzlich hochgeladen (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 

PowerShell and SharePoint @spsnyc July 2012

  • 1. Talbott Crowell July 28, 2012 SharePoint Saturday NYC #SPSNYC http://www.thirdm.com @talbott
  • 2. What is PowerShell? • PowerShell Basics • Tools • PowerShell and SharePoint • Creating SharePoint 2010 Cmdlets • Iteration Style Scripts www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 3. Unix-like shell • Object oriented • .NET • Command line • Scripting language www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 4. • Windows PowerShell in Action – by Bruce Payette (designer and author of PowerShell) • Windows PowerShell 2.0 Administrator's Pocket Consultant – By William R. Stanek www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 5. Automated build and deploy • Rapid prototyping • Exploring “What If” scenarios • Developer onboarding • Administration automation www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 6. • When you want to make your team more agile – Automation, automation, automation • When developing, your daily build is like the projects heartbeat – PowerShell can be the pacemaker • Testing – Use the PowerShell scripts to stand up an environment for running tests www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 7. • What do you know about a command line? – DIR • How about – $a = DIR • What is $a? – .NET Object • use gm or get-member to query properites – Array • $a[0] www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 8. • PowerShell Basics – $a = DIR – $a | gm – Dates www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 9. • cmd, notepad • PowerShell Command • Windows PowerShell Integrated Scripting Environment (ISE) – Import-Module ServerManager; – Add-WindowsFeature PowerShell-ISE • PowerGUI – Download from powergui.org www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 10. # for comment • Verb-Noun convention for commandlets • Write-Host “Hello World” • Set-ExecutionPolicy Unrestricted • .scriptname to execute www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 11. • Comes with PowerShell Commandlets – Get-SPSite – New-SPSite – New-SPWeb • If you are running from standard PowerShell Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinue www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 12. • Get-SPSite – Parameter: url • New-SPSite – Parameters: url, name, ownerAlias, template • New-SPWeb – Parameters: url, name, description, template… – Other params: • -AddToTopNav or -UseParentTopNav • -AddToQuickLaunch www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 13. • Your friend STSADM is still there • You can call STSADM or any command line tool from PowerShell • You can write your own command line tools with .NET • Better yet, you can write your own PowerShell Commandlets! – Inherit from Cmdlet or PSCmdlet • Gary Lapointe has WSS and MOSS Cmdlets! – http://stsadm.blogspot.com/2009/02/downloads.html www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 14. • When creating non-persistent tasks (i.e. get info) use: – SPCmdlet • When objects persist between commands, use: – SPRemoveCmdletBase – SPNewCmdletBase – SPSetCmdletBase – SPGetCmdletBase • For more info, see Gary Lapointe’s blog post: – http://stsadm.blogspot.com/2009/10/creating- custom-sharepoint-2010-cmdlets.html www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 15. • [void][System.Reflection.Assembly]::LoadWith PartialName(”Microsoft.SharePoint”) – Load the assembly • $SPSite = New-Object Microsoft.SharePoint.SPSite($url) – Reference to the site collection using SharePoint object model • Don’t forget to – $SPSite.Dispose() www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 16. • Series of scripts to build your site • Cleanup script to destroy site • Edit script, run cleanup, run script, view site – Repeat www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 17. • Build2010.ps1 – Calls other scripts • Build2010_site_structure.ps1 – Sets up the basic site structure and content types • Build2010_upload_file.ps1 – Uploads sample files to the site • Build2010_set_logo.ps1 – Adds site logo • Build2010_add_users.ps1 – Adds users to local machine and/or SharePoint groups www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 18. • function Get-Theme ([Microsoft.SharePoint.SPWeb]$SPWeb, [string]$themeName) • Strong typed parameters • Returns Microsoft.SharePoint.Utilities.ThmxTheme www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 19. • Upload File – Takes in 1 or more files • Has 3 blocks – Begin – Process – End • Process is executed for each file • gci 'C:uploadfilesSamplesLegal' | .build2010_upload_file.ps1 -Location "shared/legal" - DocLib "Documents" -ContentType "Document" - MetaDataField "Dept" -MetaDataValue "Legal" www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 20. • Windows PowerShell in Action – by Bruce Payette (designer and author of PowerShell) • Windows PowerShell 2.0 Administrator's Pocket Consultant – By William R. Stanek www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 21. • How to: Build a SharePoint 2010 PowerShell Cmdlet – http://silverlight.sys-con.com/node/1370916 • Microsoft TechNet – http://technet.microsoft.com/en-us/library/bb978526 www.sharepointsaturday.org/boston::WEB http://www.thirdm.com WEB http://talbottcrowell.wordpress.com::EMAIL SPSBoston@live.com BLOG @talbott : TWITTER @SPSBoston / #SPSBos : TWITTER
  • 22. • Please remember to turn in your filled out bingo cards and event evaluations for prizes. • SharePint is sponsored by Summit 7 Systems across the way at the Hilton NYC. • Follow SharePoint Saturday New York City on Twitter @spsnyc and hashtag #spsnyc 22 | SharePoint Saturday New York City 2011
  • 23. Thanks to Our Sponsors!
  • 24. Talbott Crowell ThirdM.com http://talbottcrowell.wordpress.com/ Twitter: @talbott