{"id":956,"date":"2019-03-15T06:25:38","date_gmt":"2019-03-15T06:25:38","guid":{"rendered":"http:\/\/blog.softreeconsulting.com\/?p=956"},"modified":"2019-03-15T06:25:38","modified_gmt":"2019-03-15T06:25:38","slug":"add-and-manipulate-modern-sharepoint-page-using-pnp-powershell","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/","title":{"rendered":"Add And Manipulate Modern SharePoint Page Using PnP PowerShell"},"content":{"rendered":"\n<p>In this blog, we will look at the steps to add and manipulate Modern SharePoint page using PnP PowerShell.<\/p>\n\n\n\n<p><strong>Adding a Modern page to the SharePoint site<\/strong><\/p>\n\n\n\n<p>The&nbsp;<em>Add-PnPClientSidePage<\/em>&nbsp;command is used to add a modern page to the SharePoint site.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Add-PnPClientSidePage -Name &#8220;NewPage&#8221;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell02.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p>By default,&nbsp;<em>Add-PnPClientSidePage&nbsp;<\/em>creates an Article layout type. To create the Home layout type, we have to pass &#8220;Home&#8221; as a \u201cLayoutType\u201d parameter.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Add-PnPClientSidePage -Name &#8220;NewPage&#8221; -LayoutType Home<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell03.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell04.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Set<\/strong><strong>&nbsp;the Modern page Property<\/strong><\/p>\n\n\n\n<p>The&nbsp;<em>Set-PnPClientSidePage<\/em>&nbsp;command is used to update the property of a SharePoint Modern page.<\/p>\n\n\n\n<p><strong>Example 1<\/strong><\/p>\n\n\n\n<p>This example updates the properties of the modern page named &#8220;MyPage&#8221;.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Set-PnPClientSidePage -Identity &#8220;NewPage&#8221; -Title &#8220;MyPage&#8221;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell05.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell06.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Example 2<\/strong><\/p>\n\n\n\n<p>This example disables the comments on the Modern page.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Set-PnPClientSidePage -Identity &#8220;NewPage&#8221; -CommentsEnabled:$false<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell07.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell08.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Example 3<\/strong><\/p>\n\n\n\n<p>This example enables the comments on the Modern page.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Set-PnPClientSidePage -Identity &#8220;NewPage&#8221; \u2013CommentsEnabled<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell09.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell06.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Gett<\/strong><strong>ing the Modern page information<\/strong><\/p>\n\n\n\n<p>The&nbsp;<em>Get-PnPClientSidePage<\/em>&nbsp;command is used to get information about the SharePoint Modern page.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Get-PnPClientSidePage -Identity &#8221; NewPage&#8221;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell10.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>Removing a Modern&nbsp;page from the SharePoint site<\/strong><\/p>\n\n\n\n<p>The&nbsp;<em>Remove-PnPClientSidePage<\/em>&nbsp;command is used to remove the specified modern page from the SharePoint site collection.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Remove-PnPClientSidePage -Identity &#8220;NewPage&#8221;<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell11.png\" alt=\"Add and Manipulate Modern SharePoint Page Using PnP PowerShell\"\/><\/figure>\n\n\n\n<p><strong>This solution is brought to you by our SharePoint professionals.<\/strong><\/p>\n\n\n\n<p><a href=\"http:\/\/www.softreeconsulting.com\/\">Softree Technology<\/a>\u00a0employs SharePoint consultants; we are a technology services provider with the aim to help companies achieve exceptional performance through SharePoint. Our dedicated team of SharePoint consultants has the right bent of mind to understand and execute customer requirements.<\/p>\n\n\n\n<p>Be it\u00a0<a href=\"https:\/\/www.softreetechnology.com\/sharepoint-spfx-developments\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"SPFx or SharePoint (opens in a new tab)\">SPFx or SharePoint<\/a><a href=\"http:\/\/www.softreeconsulting.com\/sharepoint-spfx\/\">\u00a0<\/a>add-in developments,\u00a0SharePoint 2019 developments, web part developments, migrating from SharePoint 2010\/2013 to SharePoint 2013\/2016\/Office 365, Office 365,\u00a0SharePoint hosted apps development\u00a0or something else in SharePoint, we strive to deliver the best<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we will look at the steps to add and manipulate Modern SharePoint page using PnP PowerShell. Adding a Modern page to the SharePoint site The&nbsp;Add-PnPClientSidePage&nbsp;command is used to add a modern page to the SharePoint site. Add-PnPClientSidePage -Name &#8220;NewPage&#8221; Output By default,&nbsp;Add-PnPClientSidePage&nbsp;creates an Article layout type. To create the Home layout type, we have to pass &#8220;Home&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[221],"tags":[219,220,208],"class_list":["post-956","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-create-modern-page","tag-modern-page","tag-pnp-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Add And Manipulate Modern SharePoint Page Using PnP PowerShell - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add And Manipulate Modern SharePoint Page Using PnP PowerShell - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this blog, we will look at the steps to add and manipulate Modern SharePoint page using PnP PowerShell. Adding a Modern page to the SharePoint site The&nbsp;Add-PnPClientSidePage&nbsp;command is used to add a modern page to the SharePoint site. Add-PnPClientSidePage -Name &#8220;NewPage&#8221; Output By default,&nbsp;Add-PnPClientSidePage&nbsp;creates an Article layout type. To create the Home layout type, we have to pass &#8220;Home&#8221; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-15T06:25:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add And Manipulate Modern SharePoint Page Using PnP PowerShell - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/","og_locale":"en_US","og_type":"article","og_title":"Add And Manipulate Modern SharePoint Page Using PnP PowerShell - Softree Technology","og_description":"In this blog, we will look at the steps to add and manipulate Modern SharePoint page using PnP PowerShell. Adding a Modern page to the SharePoint site The&nbsp;Add-PnPClientSidePage&nbsp;command is used to add a modern page to the SharePoint site. Add-PnPClientSidePage -Name &#8220;NewPage&#8221; Output By default,&nbsp;Add-PnPClientSidePage&nbsp;creates an Article layout type. To create the Home layout type, we have to pass &#8220;Home&#8221; [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/","og_site_name":"Softree Technology","article_published_time":"2019-03-15T06:25:38+00:00","og_image":[{"url":"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Add And Manipulate Modern SharePoint Page Using PnP PowerShell","datePublished":"2019-03-15T06:25:38+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/"},"wordCount":296,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png","keywords":["Create Modern Page","modern page","PnP PowerShell"],"articleSection":["PowerShell"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/","url":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/","name":"Add And Manipulate Modern SharePoint Page Using PnP PowerShell - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png","datePublished":"2019-03-15T06:25:38+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#primaryimage","url":"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png","contentUrl":"https:\/\/csharpcorner-mindcrackerinc.netdna-ssl.com\/UploadFile\/BlogImages\/02082019052301AM\/Add%20and%20Manipulate%20Modern%20SharePoint%20Page%20Using%20PnP%20PowerShell.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/powershell\/add-and-manipulate-modern-sharepoint-page-using-pnp-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Add And Manipulate Modern SharePoint Page Using PnP PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=956"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/956\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}