How to add wiki page to the wiki page library in SharePoint using powershell

  $listName="A"
  $siteURL="
http://serverName:1111"
  $site=Get-SPSite $siteURL
  $web=$site.RootWeb
  $list=$web.Lists[$listName]               
  $rootFolder = $list.RootFolder
  $wikiPage = $rootFolder.Files.Add("/"+$rootFolder+"/Home.aspx", [Microsoft.SharePoint.SPTemplateFileType]::WikiPage)
  $wikiItem = $wikiPage.Item
  $wikiItem[[Microsoft.SharePoint.SPBuiltInFieldId]::WikiField] = "Template Preview" 
  $wikiItem.UpdateOverwriteVersion()
Ebook Download
View all
Learn
View all