Skip to content

Instantly share code, notes, and snippets.

@zplume
Last active June 19, 2018 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zplume/73a842cf350bae274609af9dd9a5d03c to your computer and use it in GitHub Desktop.
Save zplume/73a842cf350bae274609af9dd9a5d03c to your computer and use it in GitHub Desktop.
Script to update the AllowDeletion property of a SharePoint List. Assumes you have already connected to the relevant site with Connect-PnPOnline.
param(
[Parameter(Mandatory = $true)]
[string]$ListTitle,
[Parameter(Mandatory = $true)]
[bool]$AllowDeletion
)
$list = Get-PnPList -Identity $ListTitle
$list.AllowDeletion = $AllowDeletion
$list.Update()
$list.Context.ExecuteQuery()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment