GitHub Icon Image
GitHub

Enable page scheduling on a modern site pages library

Summary

The script enables the page scheduling feature on a modern site pages library.

Example Screenshot

Implementation

  • Open Windows PowerShell ISE
  • Create a new file
  • Copy the code below
  • Save the file and run it
  • PnP PowerShell
# Example: .\Enable-PageScheduling.ps1 -SiteUrl "https://contoso.sharepoint.com"
[CmdletBinding()]
param (
    [Parameter(Mandatory = $true, HelpMessage = "URL of the SharePoint site, e.g.https://contoso.sharepoint.com")]
    [string]$SiteUrl
)

begin  {
    Write-Host "Connecting to SharePoint Site '$($SiteUrl)'" -f Yellow
    Connect-PnPOnline -Url $SiteUrl
}
process {
    # enable page publishing scheduling on the current site
    Enable-PnPPageScheduling
}
end {
    Disconnect-PnPOnline
    Write-Host "Finished" -ForegroundColor Green
}

Check out the PnP PowerShell to learn more at: https://aka.ms/pnp/powershell

The way you login into PnP PowerShell has changed please read PnP Management Shell EntraID app is deleted : what should I do ?

Contributors

Author(s)
Nanddeep Nachan

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Back to top Script Samples
Generated by DocFX with Material UI