I have created a list and added some new fields in my sharepoint site. I now want to add my new fields onto the All Items view using Powershell is this possible? I tried :

$viewFields = New-Object System.Collections.Specialized.StringCollection

# View Name
$viewName = “All Privacy Statements”
# Finally – Provisioning the View
$myListView = $myList.Views.Add($viewName, $viewFields, "", 100, $True, $False)

$myListView.DefaultView = $True
$myList.OnQuickLaunch = $True

But this just adds a new all items view any help would be appreciated

2 Answers 2


Get the web and list:

$w = Get-SPWeb http://localhost
$l = $w.Lists["My list"];

This is how you select the view "All items":

$view = $l.Views | ? { $_.Title -eq 'All items' }

Then just add fields:


And update view:


Retrieve All Items view by using $myList.DefaultView if it is a default view or by using the index $myList.Views["All Items"]. Then add fields to it and finally update it.

$defaultView = $myList.DefaultView;
// Repeat this line for all fields


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.