Monday, November 5, 2012

Setting "In the top-level folder" Programatically

 
Spent some time today trying to figure out how to set the "In the top-level folder" option for a SharePoint view via powershell.  Below is how the screen looks  from the editor:



I dug through the JavaScript on the ViewEdit.aspx page and found that the value is set using a built in ContentTypeID for RootOfList content type.  Here is the powershell snippet I used to update the value:


Hope this helps someone out there!

1 comment:

Hill said...

Do you by chance know how to set it back to "In all folders?" Maybe just remove the content type? (Haven't tried that yet)