Forum Discussion
Remove the page title from a modern page as well as the white space? Someone has done it.
After I put this into PowerShell ISE, I get error message(s)
PS C:\Users\Michael's Surface> #Connect to SharePoint Online site
$SiteURL = "https://michaelq.sharepoint.com/work/"
Connect-PnPOnline $SiteURL -Credential (Get-Credential)
#Get the ID of the Page
Get-PnPListItem -List SitePages
#Change Page layout from "Article" to "Home"
Set-PnPListItem -List SitePages -Identity "7" -Values @{"PageLayoutType"="Home"}
These are the error message(s) I get
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Connect-PnPOnline : The term 'Connect-PnPOnline' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:3 char:1
+ Connect-PnPOnline $SiteURL -Credential (Get-Credential)
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-PnPOnline:String) [], CommandNotFoundExcepti
on
+ FullyQualifiedErrorId : CommandNotFoundException
Get-PnPListItem : The term 'Get-PnPListItem' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:5 char:1
+ Get-PnPListItem -List SitePages
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-PnPListItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Set-PnPListItem : The term 'Set-PnPListItem' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:7 char:1
+ Set-PnPListItem -List SitePages -Identity "7" -Values @{"PageLayoutTy ...
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-PnPListItem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
https://www.microsoft.com/en-us/download/details.aspx?id=35588