PowerShell Scripts for Sharepoint 2010 & 2013
Here are some useful Sharepoint PowerShell scripts : Create a site New-SpWeb "http://sp2010/Site1" -Name "Site 1" -template "STS#0" Delete a site Remove-SPWeb "http://sp2010/Site1" -Confirm:$false Create a List $web=get-spweb -Identity "http://sp2010/Site1" $web.Lists.add(<List Name>,<List Description>,<List Template>) $list = $web.getList("http://sp2010/Site1/Lists/List1") $FieldType = [Microsoft.Sharepoint.SPFieldType]::Text $List.Fields.Add("Name",$FieldType,$false) Delete a List $list = $web.getList("http://sp2010/Site1/Lists/List1") $list.delete() Add a list item $item=$list.items.add() $item["Title"] = "Your title here" $item.update() Update a list item $item = $list.getItemById(1) $item["Title"]="New Title" $item.update() Delete a list item $item = $list.getItemById(1) $item.delete() Export a list to ...