GET-SPWEBTEMPLATE는 내 템플릿을 표시하지 않아야합니다.
-
10-12-2019 - |
문제
나는 기본적으로 웹 템플릿을 설치했고 잘 설치되었습니다.웹 사이트를 만들려고 할 때 나는이 템플릿을 목록에 본다면이 템플릿을 선택하여 사이트를 만듭니다.
그러나strangly한 정도로, 그것은아마도잘등록되지또는나는이유는 모르겠지만,내가PowerShell을명령GET-SPWebTemplate을 실행할 때이없다.나는 또한 SiteTemplate의 하이브에서 그것을 발견 할 수 있습니다 ...
나는 캐시를 청소하고 IISRESET을했지만 여전히 작동하지는 않지만, 어떻게 해결합니까?
해결책
Your webtemplate is probably not globally deployed
[..]the documentation for Get-SPWebTemplate which states “Displays all globally installed site templates that match the given identity.” A sandboxed solution is not globally deployed, which explains why the template couldn’t be found. Source
Try this:
$web = get-spweb http://intranet
$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Name -eq "My Custom Template Name"}
#Uncomment to create web..
#New-SPWeb -Url "http://intranet/site1" -Name "Site 1" –Template $template
This will get it from available web templates instead, see more (and source of above script) here
다른 팁
After trying to figure this out myself, I got the following that is dynamic. Hope this helps someone else that needs to use a template in multiple places.
$Siteurl = "http://intranet/site/custom"
$SPW = Get-SPweb $Siteurl
$template = $SPW.GetAvailableWebTemplates(1033) | Where-Object {$_.Title -eq "MyCustomTemplate"}
write-host "Applying custom template..."
$SPW.ApplyWebTemplate($template.Name)
$SPW.update()
Perhaps you may need to restart the server. I recently had a similar issue. However, I was migrating from SP 2010 to SP 2013. See here for more info: http://sharepointnadeem.blogspot.com/2014/01/sharepoint-2013-missingsitedefinition.html