Remove Timeline from a task view using PowerShell

If you create a new view for a SharePoint 2013 task list, you’ll get a timeline above the task items table.

Should you want to remove this timeline from the view using PowerShell, you should alter the ViewData property for the view.

Initially, this property contains the following data:

<FieldRef Name="PercentComplete" Type="StrikeThroughPercentComplete" /><FieldRef Name="DueDate" Type="TimelineDueDate" />

Simply remove the second FieldRef element from the view’s ViewData to remove the Timeline from the view:

$web = Get-SPWeb <insert web URL>
$view = $web.GetViewFromUrl(<insert view URL>
$view.ViewData = "<FieldRef Name=`"PercentComplete`" Type=`"StrikeThroughPercentComplete`" />"
$view.Update()
$web.Dispose()

One thought on “Remove Timeline from a task view using PowerShell

Leave a Reply to NenadNS Cancel reply

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