intro to powershell jack fruh sharepointjack.com
TRANSCRIPT
![Page 1: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/1.jpg)
Intro To PowerShell
Jack FruhSharepointjack.com
![Page 2: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/2.jpg)
And now a word from ourSponsors
![Page 3: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/3.jpg)
Thank you #SPSTC sponsors!
![Page 4: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/4.jpg)
About Me…
@sharepointjack
![Page 5: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/5.jpg)
SharePointJack.com
Last year was a milestone year, as the site crossed the 5 unique visitors milestone. I’m pretty sure my Mom and Dad were two
of them, I can only guess that my uncle Hershel and aunt Mildred were also enticed to visit the site after the yearly
family Christmas newsletter went out. People still do those right?
![Page 6: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/6.jpg)
Demo
• How to start PowerShell,• The difference between “Plain” and
“SharePoint” PowerShell• Your first PS command: Get-Command• Your first PS Program:• $a = get-command• $a.count()
![Page 7: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/7.jpg)
Demo (cont)
• Turn “plain” PowerShell into “SharePoint” PowerShell with this command:
• Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
![Page 8: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/8.jpg)
What you should do to learn PowerShell
1) Download the PowerShell Cheat Sheet
2) Print it3) Tape it on
your desk
![Page 9: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/9.jpg)
What you should do to learn PowerShell & SharePoint
1) Download the SharePoint PS Cheat Sheet
2) Print it3) Tape it on
your desk4) Look over the
SP Object Model
![Page 10: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/10.jpg)
Understanding SharePoint’s internals will help greatly!
• Knowing the “Object Model” will go a long, long, long, long, long way towards knowing what to look for in PowerShell or what to search for on the internet when seeking help
![Page 11: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/11.jpg)
SharePoint Object Model Compared to a School System
SPFarm Farm is the top level in the object model. Managed via Central Admin A farm will have one or more Web
Applications SPWebApplication Found in IIS as an IIS website Determines the Base URL of the site Contains 1 ore more Site Collections
SPSite Same as “Site Collection” An Organizational unit Can easily move a whole SPSite
between Databases Each SPSite contains 1 ore more
SPWEB’s
SPWeb Where real work happens Contains Lists, libraries, Pages, etc..
School District School District oversees all schools in the
district. Address of Office ≠ Address of School(s) A School District will have 1 or more
SchoolsSchool Found within the physical boundaries of
the taxing school districts geographical area
Has a physical address people go to. Has 1 or more Departments
Department A way to organize teachers and
classes by purpose Math Department Athletic Department etc.
Classroom Where learning happens Contains books, supplies,
whiteboards, etc.
![Page 12: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/12.jpg)
Exploring SharePoint PowerShell
• Get-Command *-SP*• Get-help• Get-Help (command)• Get-help get-spweb• Get-help get-spweb –detailed• Get-help get-spweb –examples
![Page 13: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/13.jpg)
Understanding Help Output
Understanding the “Syntax” part…
![Page 14: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/14.jpg)
“Pipe” output from one command to the Input of another
![Page 15: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/15.jpg)
The most Common “Pipe Targets”Some-Command | Sort name, dateSome-Command | Format-TableSome-Command | Select nameSome-Command | Select –last 3Some-Command | Where {$_.name –like “Jack*”}
![Page 16: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/16.jpg)
Graduating from one line commands:Scripts & the “ISE”
(Integrated Scripting Environment)
![Page 17: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/17.jpg)
ISE Scripting
• Since the ISE opens “Plain”, be sure to add in the SharePoint PowerShell Snapin with
Add-PSSnapin Microsoft.SharePoint.PowerShell
![Page 19: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/19.jpg)
Example/Demo’s and Questions:Save all the WSP’s on your farm….
![Page 20: Intro To PowerShell Jack Fruh Sharepointjack.com](https://reader038.vdocuments.site/reader038/viewer/2022110211/56649f065503460f94c1bae1/html5/thumbnails/20.jpg)
Example/Demo
See how big your Content Databases Are…