PoshCode Archive  Artifact [56ae5874fa]

Artifact 56ae5874faad553cf9ee2f03644e888dc6c2ca12d6fab2f6c54ba690f98a5ef3:

  • File viewAllTemplate.ps1 — part of check-in [31dde5f63e] at 2018-06-10 13:28:24 on branch trunk — viewAllTemplate.ps1 (user: brodobrey size: 1533)

# encoding: ascii
# api: powershell
# title: viewAllTemplate.ps1
# description: viewAllTemplate.ps1
# version: 0.1
# type: function
# author: brodobrey
# license: CC0
# function: Get-SPWebTemplateWithId
# x-poshcode-id: 3631
# x-archived: 2012-09-15T04:07:02
# x-published: 2012-09-07T06:38:00
#
#
<#  view all template wsp on custom site url

    based on
    http://www.danielbrown.id.au/Lists/Posts/Post.aspx?ID=74
#>


$site = Get-SPSite "http://spf"
     $web = $site.OpenWeb();
     foreach($lang in $web.RegionalSettings.InstalledLanguages)
     {
         Write-Host "Displaying Sites for Langauge: " $lang.DisplayName;
         $site.GetWebTemplates($lang.LCID) | Format-Table -Property Title, Name
     }
     $web.Dispose();
     $site.Dispose();
     
     
    <# second view not all template     #>
    
   
<#
function Get-SPWebTemplateWithId
{
    $templates = Get-SPWebTemplate | Sort-Object "Name"
    $templates | ForEach-Object {
        $templateValues = @{
            "Title" = $_.Title
            "Name" = $_.Name
            "ID" = $_.ID
            "Custom" = $_.Custom
            "LocaleId" = $_.LocaleId
        }
        New-Object PSObject -Property $templateValues | Select @("Name","Title","LocaleId","Custom","ID")
    }
}
Get-SPWebTemplateWithId | Format-Table

#>


<#
   $site = Get-SPSite "http://spf"
   foreach ($web in $site.AllWebs) { 
   $web | Select-Object -Property Title,Url,WebTemplate 
   }
   $site.Dispose()
   
   #>