1.Click "Start" button
2.Choose the "Microsoft SharePoint 2010 Products"
3.Click the "SharePoint 2010 Management Shell" [ run as Administrator ]
Syntax:-
$web = Get-SPWeb "SiteCollectionURL"
2.Choose the "Microsoft SharePoint 2010 Products"
3.Click the "SharePoint 2010 Management Shell" [ run as Administrator ]
Syntax:-
$web = Get-SPWeb "SiteCollectionURL"
$spFolder = $web.GetFolder("List Template Gallery")
$spFileCollection = $spFolder.Files
$file = Get-ChildItem "StpfilePath"
$spFileCollection.Add("_ catalogs/lt/StpFileName", $file.OpenRead(), $true)
Example:-
$web = Get-SPWeb "http://Abcd/sites/ SamSite"
$spFolder = $web.GetFolder("List Template Gallery")
$spFileCollection = $spFolder.Files
$file = Get-ChildItem "C:\Users\Administrator\ Desktop\Mohamed sithik\Employee.stp"
$spFileCollection.Add("_ catalogs/lt/Employee.stp", $file.OpenRead(), $true)
No comments:
Post a Comment