Today I started my screencast series about how to empower sharepoint using powershell. The microphone I use sucks, but still trying to learn this screenrecording stuff. =) Part 1 is a short introduction to doing some basic tasks such as creating sites and items in a list. Also I show how to load the needed assemblies. Please watch it; and send comments about the content etc to me to make theese casts better – its quite new to me to “talk and present” into a computer. =) Below the video you will find some code used in the demo.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
#How to load assemblies for Sharepoint [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Portal") # Get the website collection object $SPSite = New-Object Microsoft.SharePoint.SPSite "http://se-wks-daniels" # Get the root web $RootWeb = $SPSite.RootWeb # Creating a site and put that into $NewSite $NewSite = $SPSite.AllWebs.Add("CPS", "PSSite", "Created in PS", 1033, "STS#0", $true, $false) # Create new item $SPList = $NewSite.Lists["Announcements"] $SPListItem = $SPList.Items.Add() $SPListItem["Title"]="New announcement!" $SPListItem["Body"]="This announcement is done from powershell. Imagine the possibilities." $SPListItem.Update() |