Forum Discussion
Vimal Patel
Apr 12, 2019Copper Contributor
SharePoint Online - Missing Site Assets Library
We have a PowerShell based provisioning process to create Modern Communication Sites in batches on SharePoint Online (SPO). In the past few weeks all the sites we created had Site Assets Library miss...
Leif Frederiksen
May 13, 2020Copper Contributor
I am experiencing something similar. We provision modern Team sites, and there is no Site Assets library. However, upon investigating this I found, that as soon as I enter "Site contents" (from the Gear-icon in the UI) the library suddenly appears.
I need a way to ensure that the Site Assets library will be available WITHOUT doing some UI thing. I don't want to enable "publishing features" since this is a Team site and has nothing to do with publishing.
Any ideas?
Leif Frederiksen
May 13, 2020Copper Contributor
Replying to my own question after some more googling 😉
The "EnsureSiteAssetsLibrary" function does the trick:
$targetWeb = Get-PnPWeb -Connection $targetConnection
$targetWeb.lists.EnsureSiteAssetsLibrary()![]()