C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
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
10y
24
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-
People also reading
Membership not found