Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
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.9
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
People also reading
Membership not found