Created
July 18, 2019 21:36
-
-
Save antonio-leonardo/7c7f0b040821329dadd4c6cf249f4048 to your computer and use it in GitHub Desktop.
Delete a corrupted SharePoint list
This file contains hidden or 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
##Script para Deletar Listas corrompidas | |
Add-PSSnapin Microsoft.SharePoint.PowerShell | |
#Get the Web | |
$web = Get-SPWeb "<SharePoint-site-URL>" | |
#Get the corrupted List | |
$list = $web.lists["corrupted list name"] | |
#Set the AllowDeletion Flag to True | |
$list.AllowDeletion = $true | |
$list.Update() | |
#Delete the list | |
$list.Delete() | |
#Or can try this | |
#Get-SPWeb "http://sharepoint-site-url" | where-object { $_.Lists["corrupted list name"].Delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment