Delete SharePoint 2010 Library View

We tried modifying the view in SharePoint 2010 using Designer 2010 and it’s corrupted! No option to delete the view !

Spin up your SharePoint Shell Management and execute the below code

Start-SPAssignment -Global
$SPWeb = Get-SPWeb $WebUrl
$List = $SPWeb.Lists[$ListName]
$View = $List.Views[$ViewName]
#$view.ID
$List.Views.Delete($View.ID)
$List.Update()
$SPWeb.Update()
$SPWeb.Dispose()
Stop-SPAssignment -Global

 

 

Note: Ensure the View you are removing. Cross check by it’s ID [GUID]

Published by

Chen V

I am a SharePoint 2010 IT Pro. My area of interests are Workflows, Automation, Office 365 , Identity and Access Management, PowerShell and Windows Servers.

Leave a Reply

Your email address will not be published. Required fields are marked *