In this blog, I have explained how to get SharePoint list items count using power shell script.
Follow the below steps:
- Create a SharePoint List (say Continents).
- Open the Power Shell ISE as administrator.
- Paste the below code after changing site url an your list name.
- cls
- add-pssnapin microsoft.sharepoint.powershell
- $URL="http://moss13:1111/"
- $ListName="Continents"
- $SPWeb=Get-SPWeb $URL
- $SPList=$SPWeb.Lists[$ListName]
- $listitems = $SPList.Items.Count
- Write-Host "Items in list: " $listitems
- The output will be as below: