Article archive
Set word table row properties in powershell
10/01/2013 13:55
$rows=6
$columns=2
$range = $selection.Range
$table=$document.Tables.add($range,$rows,$columns)
#set bold font for cell
$table.Cell(1,1).Range.Font.Bold = $true
#set border as visible
$table.Borders.Enable=$true
#set Row height...
Add xsl attribute to HTML tag
09/01/2013 14:28
<a>
<xsl:attribute name="href">
<xsl:value-of select="https://server/site/page.aspx" />
</xsl:attribute>
My Page
</a>
or you...
Xslt select attribute of element
09/01/2013 14:16
In case we have $Rows variable and want to take 'Title' attribute from first row of $Rows
<xsl:value-of select="$Rows[1]/@Title"/>
or in Content Query web part xml - Get listId of second Row element (321) - index start is 1, not 0
<xsl:value-of...
DateTime format in Xslt
09/01/2013 14:08
Format Date in Xslt
1. Add ddwrt namespace to xslt file header
xmlns:ddwrt="https://schemas.microsoft.com/WebParts/v2/DataView/runtime"
2. Use ddwrt functions
<xsl:value-of select="ddwrt:FormatDateTime(@Created, 1033, 'd MMMM yyyy')" />
for 14 january...
Display Error Messages on Sharepoint Site
09/01/2013 14:05
modify Web.config in inetpub (for your web application) - change-as admin, iisreset
CustomErrors mode="Off"
Callstack="True"
Debug=true
Create word document with multiple tables from powershell
21/12/2012 23:28
Scripts in this two files create word document with multiple tables. Each table is for Sharepoint List Instance and fetches several properties. Input parameter is source folder, in which are found all Elements.xml files with List Instance.
ExportSiteListsToWord.ps1
#Create Word table...
Find string in files and subfolders (all list definition files)
21/12/2012 10:45
#$sourceFolder="c:\temp\Documents"
#List Templates
$pattern = "<ListTemplate"
#Find all files with <List Template tag, exclude files in packages, select only Elements.xml files
$listDefinitionFiles = Get-ChildItem $sourceFolder -recurse...
Set default content type for a sharepoint list
20/12/2012 13:04
$siteUrl="https://server/sitecollection"
$defaultContentTypeName="Custom Content Type Name"
Start-SPAssignment -Global
$web = get-spweb $siteUrl
$list = $web.Lists["Pages"]
$folder = $list.RootFolder
$result = New-Object...
Set anonymous access for sharepoint list
18/12/2012 11:42
$list = $rootWeb.GetList($listUrl)
$list.AnonymousPermMask64 = [Microsoft.SharePoint.SPBasePermissions]::ViewListItems -bor [Microsoft.SharePoint.SPBasePermissions]::OpenItems -bor [Microsoft.SharePoint.SPBasePermissions]::ViewVersions -bor [Microsoft.SharePoint.SPBasePermissions]::Open -bor...
Add List Items of different type by powershell
17/12/2012 12:20
There are several field types in Sharepoint 2010 and each of them is filled in different way. Here are some examples:
$spWeb = Get-SPWeb -Identity "http//server/sitecollection"
$spWeb.AllowUnsafeUpdates=$true
$spList = $spWeb.Lists["My List"]
$spListItem = $spList.AddItem()
#Single line of...
Items: 221 - 230 of 384