Get List Items from SharePoint View in PowerShell

Requirement: Get all list items from a SharePoint view in PowerShell

sharepoint powershell get items in listview

SharePoint PowerShell to Get Items in List view

Here is the PowerShell script example to get list items from a SharePoint view:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$ListName = "Invoice"
$ViewName = "2014 Invoice"

#Get Web and List objects
$web = Get-SPWeb $SiteURL
$list = $web.Lists[$ListName]

#Get the View
$view = $list.Views[$ViewName]

#Get All Items from the View
$items = $list.GetItems($view)

foreach($item in $items)
    write-host $item["Title"]

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply