1
Vote

Consider Changing from Title to Name

description

Get-SPWebTemplate returns two templates if you use "Publishing Site" corresponding to CMSPUBLISHING#0 and BLANKINTERNET#0. I changed the script to use $_.Name instead which is unique. Of course the downside is you have to know the Template Name syntax. :)
 
$webTemplate = Get-SPWebTemplate | where { $_.Name -eq $SiteTemplate}

comments

MatthewMcD wrote Feb 12, 2012 at 3:41 PM

Fixed Typo

wrote Feb 14, 2013 at 12:31 AM