Get-SPWebTemplate

显示与给定标识匹配的所有全局安装的网站模板。

语法

Get-SPWebTemplate
   [[-Identity] <SPWebTemplatePipeBind>]
   [-AssignmentCollection <SPAssignmentCollection>]
   [-CompatibilityLevel <UInt32>]
   [<CommonParameters>]

说明

Get-SPWebTemplate cmdlet 将显示与给定的标识完全匹配或部分匹配的所有已安装的网站模板。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

--------------示例 1-----------------

$template = Get-SPWebTemplate "STS#0"
New-SPSite https://contoso.com -OwnerAlias "DOMAIN\JDOE" -Template $template

此示例使用团队网站 Web 模板 (ID=STS#0) 创建网站集。

--------------示例 2-----------------

Get-SPWebTemplate "STS*"

此示例显示有关所有 STS 模板的基本信息。

参数

-CompatibilityLevel

指定创建新 SPSite 对象时要使用的模板版本。 该值设置网站集的初始 CompatibilityLevel 值。 此参数的值可以是 SharePoint Server 或 SharePoint Server。 如果不指定此参数,CompatibilityLevel 默认为 Web 应用程序可能的最高版本,具体取决于 SiteCreationMode 设置

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要显示的 Web 模板的名称。

键入的值必须为 Web 模板的 ID,或者 Web 模板的完整名称或部分名称。

Type:SPWebTemplatePipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition