This Advanced PowerShell Function uses the ListTemplates Property of an SPWeb Object to retrieve available SharePoint 2010 List and Library Templates.

2.7 Star
Add to favorites
E-mail Twitter Digg Facebook
  • Comment
    1 Posts | Last post September 20, 2011
    • Ryan, apparently line breaks are not respected by the Q/A functionality - this makes my proposed code difficult to read. Copy and paste out what I posted into Notepad or something to take a look. A thread on the forum that I posted,, contains similar SPAssignment code if you wish to look at it formatted correctly.
  • Function Comment - Potential Improvement
    1 Posts | Last post September 20, 2011
    • Ryan,
      Thanks for sharing this function. I'd like to propose one improvement so the -Global SPAssignment isn't used which could cause issues if your function is used in conjunction with other scripts/functions that use the -Global SPAssignment:
      $webSPAssignment = Start-SPAssignment 
      $SPWeb = $webSPAssignment | Get-SPWeb -Identity $Web 
      #$SPWeb.Dispose() <---Comment out this line or remove it
      $webSPAssignment | Stop-SPAssignment 
      This way, only the targeted SPWeb used by the function will be disposed and this will not impact the -Global SPAssignment if there is anything else that is targeted by -Global.
      Kind regards,