Delete Quick Links using Powershell

Leave a Comment
Hi All,

In a following post we will see about how to delete Quick Links using Powershell script in SharePoint.

Code Snippet for Deletion:
if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ea 0))
{
Add-PSSnapin Microsoft.SharePoint.PowerShell
}


$web=Get-SPWeb "http://xyz"

$count =$web.Navigation.QuickLaunch.Count

Write-host "Count of Quick Launch Items:  " $count
if($count -ge 0)
{
for ($i =$count -1; $i -ge 0; $i--)
    {
     write-host $subWeb.Navigation.QuickLaunch[$i].Title "heading deleting...... "
     $web.Navigation.QuickLaunch[$i].Delete()
     write-host "heading deleted successfully !!!."
    }
  $web.Update()
  $web.Delete()
}


Hope it useful,
Thanks.


Related Post

0 comments:

Post a Comment