Add Photo library to Sharepoint 2013 via powershell -
i need add new photo library in sharepoint 2013. have of script, need template type.
here script
enter code here [cmdletbinding()] param( [parameter(mandatory=$true,valuefrompipeline=add-sp$true)] [string]$web, [parameter(mandatory=$true)] [string]$listtitle, [parameter(mandatory=$true)] [string]$listurl, [parameter(mandatory=$false)] [string]$description, [parameter(mandatory=$true)] [string]$template ) add-pssnapin "microsoft.sharepoint.powershell" start-spassignment -global $spweb = get-spweb -identity $web **$listtemplate = $spweb.listtemplates[$template]** $spweb.lists.add($listurl,$description,$listtemplate) $list = $spweb.lists[$listurl] $list.title = $listtitle $list.update() $spweb.dispose()
stop-spassignment -global
above $listtemplate = $spweb.listtemplates[$template] line bold because issue is. when run script passing in string "library" issue $listtemplate variable null , fails on next line.
is there different value $template parameter? else possibly doing wrong?
thanks
jim
the template type should passed in "picture library". other code stays same.
Comments
Post a Comment