Change list default view
09/01/2014 10:21
#input parameters
$webUrl = https://yoursitecollectionurl
$listName = "MyList"
$web = get-spweb $webUrl
$list = $web.Lists[$listName]
$view = $list.DefaultView
#important: Use Capitals when writing FALSE, False doesn't work
$camlQuery = "<Where></Where><OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>"
$view.Query = $camlQuery
$view.Update()
$list.Update()