Skip to content

Instantly share code, notes, and snippets.

@rjesh-git
Created April 16, 2016 03:14
Show Gist options
  • Save rjesh-git/d3c5157b14862bfa4bbda65173a3285e to your computer and use it in GitHub Desktop.
Save rjesh-git/d3c5157b14862bfa4bbda65173a3285e to your computer and use it in GitHub Desktop.
$pubPageInfo = New-Object Microsoft.SharePoint.Client.Publishing.PublishingPageInformation
$pubPageInfo.Name = $CSVitem.Name.Replace(" ", "-") + ".aspx"
$pubPageInfo.PageLayoutListItem = $tpLayoutItem
$pubPage = $pubWeb.AddPublishingpage($pubPageInfo)
$ctx.Load($pubPage)
$ctx.ExecuteQuery()
$listItem = $pubPage.get_listItem()
$ctx.Load($listItem)
$ctx.ExecuteQuery()
$listItem.Set_Item("Title", $CSVitem.Title)
$listItem.Set_Item("PublishingPageContent", $CSVitem.Description)
$listItem.Set_Item("SeoMetaDescription", $CSVitem.ContentSummary)
$listItem.Set_Item("SOME-MANAGED-METADATA-COLUMN",'GUID GOES HERE OR READ FROM CSV')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment