Last active
March 8, 2022 08:50
-
-
Save aflyen/afce1fc44f66e4d2c43194bfbf3d3893 to your computer and use it in GitHub Desktop.
Hide the template gallery from modern team and communication sites in SharePoint Online using C# and PnP.Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task DisableTemplateGalleryDialog(SharePointClientContext context) | |
{ | |
Web web = context.Web; | |
context.Load(web); | |
await context.ExecuteQueryRetryAsync(); | |
web.WebTemplatesGalleryFirstRunEnabled = false; | |
web.Update(); | |
await context.ExecuteQueryRetryAsync(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment