Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Read SharePoint List Item in Tabular form using PowerShell Script
WhatsApp
Abhay Shanker
9y
23.8
k
0
0
25
Blog
Prerequisite
SharePoint custom list (say continents) with some records as below:
Open the powershell ISE with run as administrator and run the below code:
cls
add - pssnapin microsoft.sharepoint.powershell
$URL =
"http://moss13:1111/"
$ListName =
"Continents"
$SPWeb = Get - SPWeb $URL
$SPList = $SPWeb.Lists[$ListName]
$SPListItems = $SPList.Items | Where {
$_[
'ID'
] - ge 1
}
Write - Host(
"|{0,3}|{1,15}|{2,12}|{3,10}|"
- f
'ID'
,
'Title'
,
'Area'
,
'Population'
) - ForegroundColor yellow
Write - Host(
"________________________________________________"
)
$Items = $SPListItems | ForEach - Object {
Write - Host(
"|{0,3}|{1,15}|{2,12}|{3,10}|"
- f $_[
'ID'
], $_[
'Title'
],
$_[
'Area'
], $_[
'Population'
]) - ForegroundColor yellow
}
Write - Host(
"________________________________________________"
)
Output will be as below-
SharePoint
Up Next
SharePoint List Items Count using Power Shell Script
Ebook Download
View all
Getting Started with SharePoint Framework Development using TypeScript, PnP JS, and React JS
Read by 4.9k people
Download Now!
Learn
View all
Membership not found