PowerShell for developers

Yesterday I wrote my first PowerShell script. During that process I’ve discovered quite a few things – new to me being a .NET developer.

From /Press-Releases/Pages/Press-Release.aspx to /Press-Releases/Press-Release – URL’s for your SharePoint site - 4 steps with IIS7 URL Rewrite mo

We all know Microsoft Office SharePoint Server (MOSS) 2007 Web Content Management (WCM) solutions for their Pages URL’s. Purist web designers/developers hate SharePoint not only for the fact that it’s injecting something into URL’s but mostly for the inability of changing anything about it. And while many people think that SharePoint and semantic URL’s just don’t play along, it turns out that there is a solution – one that doesn’t involve a single line of custom code.

Generate your own SPBuiltInFieldId class

SharePoint ships with the SPBuiltInFieldId class which allows you to access the ID’s of all the out-of-the-box available fields using intellisense. This is very important in scenarios when your solution heavy relies on custom development and working with list items. The SPBuiltInFieldId class makes working with Content Types and Columns easier: instead of typing the names you can use the Properties of the SPBuiltInFieldId and get to all the standard SharePoint fields using intellisense.

Visual Studio T4 template for SharePoint Feature Definition (Feature.xml)

Recently I wrote an article about automating the generation of the DDF files used to package SharePoint Solutions. In my example I used a custom Visual Studio T4 template to generate the DDF file. As a scenario I used a Web Content Management (WCM) solution, which contained a lot of assets to be provisioned to SharePoint. While working with WCM solutions generating and maintaining the DDF files is not the only challenge. As all the different assets are being provisioned using Features you also have to maintain two more files: Feature.xml and Elements.xml. Once again the T4 templates can help you get the job done.

Programmatically creating Wiki Pages

Recently I had to prepare a demo for one of our customers. Next to the regular things like provisioning sites and lists I had to provision a Wiki Pages Library with some demo pages in it. Although you might expect a Wiki Library to be a regular list it is not and programmatically creating Wiki Pages is slightly different than creating regular items.