Sep15
Today I wanted to edit a previously created PowerShell script. This is the first time I had done this since switching to Windows 7 so I was really surprised when I right-clicked the .ps1 file and selected Edit. What I was expecting was for the script to open in Notepad, but when it opened in a PowerShell editor I was completely taken by surprise.
As it turns out, PowerShell v1.0 that ships w...
Posted by Travis Lingenfelder on
Tuesday, 15 Sep 2009 02:09.
Jul31
While working on a project I recently created a web part where I could specify a set of criteria and it would display hyperlinks to all site collections that matched. The nice thing about this web part is that you get a list of site collections that match a wide variety of criteria. Some of the criteria that could be specified was the template type, URL wildcard matching, web application, etc...
Posted by Travis Lingenfelder on
Friday, 31 Jul 2009 10:57.
Jun26
Not all classes in the SharePoint API are CLS-compliant types. While using a language like C#.NET it does not matter since the .NET framework knows how to work with these classes. Working in PowerShell is a completely different story. PowerShell does not differentiate between the various cases of names of objects, properties, or methods. This can become apparent rather quickly when, for ex...
Posted by Travis Lingenfelder on
Friday, 26 Jun 2009 02:21.
Feb27
PowerShell script that will move the SharePoint log files and set the retention of the log files.
To run this script you will need to set the PowerShell execution policy using the following PowerShell command:
set-executionpolicy Unrestricted
Copy the following code and paste it into a PowerShell script file like SetSPLog.ps1. To call this from the command line or within a command script ...
Posted by Travis Lingenfelder on
Friday, 27 Feb 2009 01:52.
Feb27
When developing scripts (and almost anything else) I prefer to hard-code any settings thay may need to be changed later. One method that I employ while writing PowerShell scripts is the use of a settings.ini file. In this file I can place any configuration information and when I need to change a setting or run the script against another environment I only need to modify a single file.
Withi...
Posted by Travis Lingenfelder on
Friday, 27 Feb 2009 01:45.