Skip to content

Instantly share code, notes, and snippets.

@OlafD
Created June 18, 2020 14:58
Show Gist options
  • Save OlafD/6a8767e37e2b0be51599b89d8563996d to your computer and use it in GitHub Desktop.
Save OlafD/6a8767e37e2b0be51599b89d8563996d to your computer and use it in GitHub Desktop.
In a SharePoint Online site with a Communication Site template, the Site Assets library is not created by default. It will automatically added, when a user uploads images or changes the site logo. This script will create the Site Assets library, when it is necessary to have it during other processes after site creation.
Connect-PnPOnline -Url {your_site_url}
$web = Get-PnPWeb
$list = $web.Lists.EnsureSiteAssetsLibrary()
(Get-PnPContext).Load($list)
Invoke-PnPQuery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment