Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Creating SharePoint List from template using client runtime

$
0
0

I'm using the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies and I'm trying to create a list in SharePoint from a custom template I have created.

The template info is as follows:

BaseType             : GenericList
Description          : Pending Reboots
FeatureId            : 00bfea71-de22-43b2-a848-c05709900100
InternalName         : PendingRebootsTemp.stp
IsCustomTemplate     : True
Name                 : PendingRebootsTemp
ListTemplateTypeKind : 100

I can create a new blank list via the following code, but I can't figure out how to create it from the template listed above. I'd like to use the template as I already have the fields set up the way I need.

$listinfo =New-Object Microsoft.SharePoint.Client.ListCreationInformation
$listinfo.Title = 'PendingRebootsTemp'
$ListInfo.TemplateType = "100"
$list = $web.Lists.Add($listinfo)
$context.ExecuteQuery()

I'm thinking this shouldn't be too difficult, but I Can't find it anywhere. Any tips?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>